How to sort records fetched from rest api and bind to table records widget ?

I am binding data "filteredcategorylist' to table records widget and implemented search. Now I want to add sort to the response recieved from API.

I have added image of RefreshTable action and this is working fine with search. How can I add logic for list sort to the filteredcategorylist.

Richwidget_Sortcolumn is binded as:



You can use the The ListSort:

You can define the list that you want to sort, The attribute and if it'as ascending or descending.

Is this what you need?

Hope this can help!

Best regards,

Ricardo M Pereira

Ricardo Pereira

I have used List sort and added sorting on CategoryName and it is working fine. 

If I click on CreatedDate and sort should work for it as well. How can I accomplish that?

How Can I made it to work for other columns?

Hi Shikha,

Good Evening!!

Could you please take column name as an Input parameter in RefreshCategoryTable and put that in List sort's "By" attribute



ok. But How can I find the sort column name to pass as input parameter?  Do I need to get clicked sort column using javascript? or there is any event in which I can get the value of sort column clicked ?

Hi Shikha,

Please take a look in this answer:

Hope this will helps :)



HI Krushana Mantri,

I did the way you told me.

I debugged the code and I am getting correct attribute in SortBy Input parameter in RefreshCategoryTable on sortcolumn click.

But ListSort server sction  is not picking the List Sort 'By' attribute correctly . Am I doing wrong somewhere?

Sorting is working fine now by passing input parameters. The only thing is to specify parameters in List Sort By like

If(AttributeName = "FirstTextAttribute",
    If(AttributeName = "SecondTextAttribute",

Hi Sikha,

you can check the below forge component as well for multiple attributes used for sorting.


Manish Jawla