Sorting a entire table using a list

We are using a specific table where list is used. It is sorting in pagination level, but we need the entire table to be sorted while refreshing structure list. 

Without refreshing the list aggregate again how can we sort the list which is in structure?

Hi Varshitha,

I am not sure if I fully understand your requirements, but if you have the entire list data that you wish to sort already available (e.g. a screen variable/Local Variable in a Server Action of data type List) and you don't want to use the Aggregate sorting capabilities, you could use the ListSort actions that are available as both Client and Server Actions for this purpose.

Let me know if this helps.


Hi Varshitha,

Assuming you are using a reactive app, the default behavior when dragging and dropping an Entity to a screen is that the platform creates for you the pagination and sort functions.

To help you understand this pattern check this and this docs.

The problem you may be facing is that this pattern has a MaxRecords and StartIndex variables created to limit the number of records fetched by the aggregate depending on the page that the user is.

Check here:

Every time you click on the pagination widget, your aggregate is refreshed and the Start Index is calculated again based on the pagethat the user is on the table.

When you use the default sort of the platform, your TableSort variable will be updated as well as your start index that will be reseted to go back to the first page:

So, if you want to fetch all data at once and handle the sort on the client side, you will have to remove the max record property, fetch all the data every time, and just sort the list on the client side as Francisco pointed.

Please keep in mind that this approach is not very performance wise, if possible you should keep using the default approach.

Hope it helps,

Cheers and Regards,

RR :)

hi Raphael Ranieri,

i tried doing this, but i am getting all the records in the table, the entire table is  not getting sorted at a time .

Hi varshitha, 

Please go through this below post and refer to the solution which I posted there. This is similar kind of scenario what you have.

hope this hepls!


Saravanan Santhanam.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.