Expression Rule

Certified Associate Developer

Hi All want to create Ann expression Rule to check weather the array of values say rollnumber with the column field in the database .

Condition

If 2 value passed and one is there and another is not there then i don't want user to continued

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi,

    Are you looking for an expression to check if RollNumber1 and RollNumber2 both exist in the database?

    a!localVariables(
      local!dataSet: a!queryEntity(
        entity: "< DSE_Constant >",
        query: a!query(
          logicalExpression: a!queryLogicalExpression(
            operator: "AND",
            filters: {
              a!queryFilter(
                field: "rollnumber",
                operator: "in",
                value: { "AB000", "AB0001" }
              )
            },
            ignoreFiltersWithEmptyValues: true
          ),
          pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50)
        ),
        fetchTotalCount: true
      ),
      if(
        local!dataSet.totalCount = length({ "AB000", "AB0001" }),
        "All Values Present",
        if(
          local!dataSet.totalCount >= 1,
          "Partially Present",
          "Not Present"
        )
      )
    )

Reply
  • 0
    Certified Lead Developer

    Hi,

    Are you looking for an expression to check if RollNumber1 and RollNumber2 both exist in the database?

    a!localVariables(
      local!dataSet: a!queryEntity(
        entity: "< DSE_Constant >",
        query: a!query(
          logicalExpression: a!queryLogicalExpression(
            operator: "AND",
            filters: {
              a!queryFilter(
                field: "rollnumber",
                operator: "in",
                value: { "AB000", "AB0001" }
              )
            },
            ignoreFiltersWithEmptyValues: true
          ),
          pagingInfo: a!pagingInfo(startIndex: 1, batchSize: 50)
        ),
        fetchTotalCount: true
      ),
      if(
        local!dataSet.totalCount = length({ "AB000", "AB0001" }),
        "All Values Present",
        if(
          local!dataSet.totalCount >= 1,
          "Partially Present",
          "Not Present"
        )
      )
    )

Children