How to retrieve two columns data (both are Text type) from a Table in Appian DB in chronological order/ascending order?

Scenario: Trying to retrieve data from two Text columns as a single array of items in chronological order/ascending order. A Query rule can order by only one column. But need to retrieve a combined list that is sorted.

Currently when tried something like {rule!GetSourceList, rule!GetRecipientList}, the data is in order for each of the query rules standalone but when combined with that {,} i am getting something as follows:

Alisha; Akhil; Daniel; Alexa; Beatle;

As you can see names with A are repeated instead of in chronologial order, because Alexa; Beatle; belong to different column retrieved with separate query rule. 

Please advise on how to do it with single query rule or by any other way?

Please advise. 

  Discussion posts and replies are publicly visible

Parents
  • Hello,

    You can create a query entity within an expression rule.

    • inside of your paging info, you can create a list of sort info elements.
    • i.e:
    • pagingInfo: a!pagingInfo(
        startIndex: 1,
        batchSize: - 1,
        sort: {
          a!sortInfo(
            field: "column_A",
            ascending: true
          ),
          a!sortInfo(
            field: "column_B",
            ascending: true
          )
        }
      )

    Another option is creating a query inside of your database with the information required and then that query can be called using a smart service.

    Basically depends on the complexity of your problem.

    regards.

  • Tried this solution it strangely returning incorrect values and in fact it did not aggregate the values from one of the column mentioned. total 12 items should have been returned. But only 10 returned with one duplicate value and other column values 3 are not in response which is below.

    List of Text String: 10 items
    "Call Center Management"
    "Civil Service"
    "Cyber Security"
    "Data Science"
    "Digital Platforms"
    "Education"
    "Finance"
    "Health Siences"
    "Insurance"
    "Insurance"
Reply
  • Tried this solution it strangely returning incorrect values and in fact it did not aggregate the values from one of the column mentioned. total 12 items should have been returned. But only 10 returned with one duplicate value and other column values 3 are not in response which is below.

    List of Text String: 10 items
    "Call Center Management"
    "Civil Service"
    "Cyber Security"
    "Data Science"
    "Digital Platforms"
    "Education"
    "Finance"
    "Health Siences"
    "Insurance"
    "Insurance"
Children
No Data