Hi I have a scenario wherein I am displaying data in my drop down by

Hi

I have a scenario wherein I am displaying data in my drop down by fetching the values from DB via. query rule or query entity. Now I want to display data in the drop down in a sorted form and I am not using sorting in my query rule or the a!sortInfo in the paginInfo of my a!query entity. Is there a way I can do it?


Thanks in advance.

OriginalPostID-208782

OriginalPostID-208782

  Discussion posts and replies are publicly visible

Parents
  • Sure. In this case I wanted to sort users without using the plugin. But this can be used for anything where you cannot sort using the actual value but have to sort by something else. My expression is

    TS_ToSortDict(itemToSort: any, itemSortBy: any)
    ={item: ri!itemToSort, sort: ri!itemSortBy}

    Then it can be used like this:

    =todatasubset(
    arrayToPage: apply(rule!DMP_ToSortDict(
    item:_,
    sort:_
    ), merge(ri!users, apply(rule!APN_displayUser(user:_), ri!users))),
    pagingConfiguration: a!pagingInfo(1, -1, a!sortInfo("sort", true))
    )
Reply
  • Sure. In this case I wanted to sort users without using the plugin. But this can be used for anything where you cannot sort using the actual value but have to sort by something else. My expression is

    TS_ToSortDict(itemToSort: any, itemSortBy: any)
    ={item: ri!itemToSort, sort: ri!itemSortBy}

    Then it can be used like this:

    =todatasubset(
    arrayToPage: apply(rule!DMP_ToSortDict(
    item:_,
    sort:_
    ), merge(ri!users, apply(rule!APN_displayUser(user:_), ri!users))),
    pagingConfiguration: a!pagingInfo(1, -1, a!sortInfo("sort", true))
    )
Children
No Data