Expression Rule that returns a list

Certified Senior Developer

How to create an expression rule that returns a list of data from a table in a database? 

I already queried in my data using a constant, now I need to create a rule that will returns a list of employee names from a database using the tables primary key (employee_id). 

  Discussion posts and replies are publicly visible

Parents
  • Try to follow the following code. If you want to display full name (firstName and lastName), try to add query column for last name. Once you get all the employee first and last names, use foreach() to concatenate both the names.

    a!queryEntity(
      entity: cons!AI_ENT_EMPLOYEE,
      query: a!query(
        selection: a!querySelection(
          columns: {
            a!queryColumn(
              field: "firstName"
            )
          }
        ),
        logicalExpression: a!queryLogicalExpression(
          operator: "AND",
          filters: {
            a!queryFilter(
              field: "id",
              operator: "in",
              value: {1,2,3,4,5}
            )
          },
          ignoreFiltersWithEmptyValues: true
        ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 50
        )
      ),
      fetchTotalCount: false
    ).data

Reply
  • Try to follow the following code. If you want to display full name (firstName and lastName), try to add query column for last name. Once you get all the employee first and last names, use foreach() to concatenate both the names.

    a!queryEntity(
      entity: cons!AI_ENT_EMPLOYEE,
      query: a!query(
        selection: a!querySelection(
          columns: {
            a!queryColumn(
              field: "firstName"
            )
          }
        ),
        logicalExpression: a!queryLogicalExpression(
          operator: "AND",
          filters: {
            a!queryFilter(
              field: "id",
              operator: "in",
              value: {1,2,3,4,5}
            )
          },
          ignoreFiltersWithEmptyValues: true
        ),
        pagingInfo: a!pagingInfo(
          startIndex: 1,
          batchSize: 50
        )
      ),
      fetchTotalCount: false
    ).data

Children
No Data