It looks like queryEntity does not support multiple sorts

Hi all,
We have a report that needs to be sorted on 3 different columns.
We have written the SQL and it works as expected in the db.

I'm using queryEntity to retrieve data.

However, on the UI it shows differently. I think it sorts on only one column.

After looking at the posts, it looks like queryEntity does not support multiple sorts.

Is this an expected behavior. If not, how can I achieve this?

Another query is, can we reset the sort order like how we set startIndex and batchSize.

Please suggest!!!

OriginalPostID-189105

OriginalPostID-189105

  Discussion posts and replies are publicly visible

Parents
  • Hi ambrishs695, You can have an additional column added to the view which will be the concatenation of the individual columns (with a space in between) and use this column as the sort field from Appian.
    Note: the above will work when all the sorting columns are of same type i.e., ASC or DESC.. if you have a mix of the fields then consider using the TRANSLATE function to translate the values to get the response in the computed column in the desired way.
    e.g: select translate('ab0cd','[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]','[ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba]') from dual --> zy0xw in the computed column.
Reply
  • Hi ambrishs695, You can have an additional column added to the view which will be the concatenation of the individual columns (with a space in between) and use this column as the sort field from Appian.
    Note: the above will work when all the sorting columns are of same type i.e., ASC or DESC.. if you have a mix of the fields then consider using the TRANSLATE function to translate the values to get the response in the computed column in the desired way.
    e.g: select translate('ab0cd','[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]','[ZYXWVUTSRQPONMLKJIHGFEDCBAzyxwvutsrqponmlkjihgfedcba]') from dual --> zy0xw in the computed column.
Children
No Data