I am trying to sort a column that is calculated using List_SortColumn. The value of the columns is coming from a server action then rendered using an Expression widget.
Here is where the value of the column calculated:
I tried putting the action in the column attribute of the List_SortColumn widget but it doesn't work
Any suggestions?
Hey,
Are you using only expressions with functions? Don't you have a full list?
To use that, you need to give the column name, not the value that you want to show in an expression. Like, if I have a list of users, and want to sort by username, that 'column' value will be User.Username, and not the attribute's value.
To use List_SortColumn, you need a list.
Cheers
I have a full list but three of my columns were calculated (came from a server action). The sorting worked on my columns like employee number which is {Employee}.[EmployeeNumber]. But on my other columns, they are calculated dates.
You should calculate them inside an aggregate or a sql, otherwise you won't be able to sort because they're not part of a list
Hi Gabriel,
I would suggest you convert GetAssessmentStartDate action to become an aggreagate/sql calculated column as part of your query in retrieving your table datasource.
Regards,
Arnold
I have a new problem now that I followed your suggestion to convert the action into an sql query. My problem is, I used structure to fetch the calculated values. How do I sort those with List_SortColumn?
Check this - https://www.outsystems.com/forums/discussion/52818/sort-list-from-local-variable-displayed/
Hello ,
Here is a thread where the solution is provided check If this helps.
https://www.outsystems.com/forums/discussion/66597/how-can-i-use-rich-widget-list-sort-column-in-a-table-where-i-have-one-calculated/https://www.outsystems.com/forums/discussion/48825/have-a-dynamic-column-i-want-to-have-be-sort-able-by-the-user/
I hope this helps
Thanks,Tousif Khan
Hi @Gabriel David ,
hope you have got your answer from here.
https://www.outsystems.com/forums/discussion/79560/how-to-sort-structure-column-using-list-sortcolumn/
so I am closing this post.