Sorting an Association in template grid

Hi, I'm trying to sort an associated list in a microflow. In short: I retrieve an List   from the database .Next I Sorted the List. After that I change the List on the  object with the new 'SortedList'. The debugger shows the 'List' with the original list at the end of the microflow. The SortedList shows the list sorted correctly. However the  association wasn't update with the SortedList at "Change 'object. The Association is the dataSource for TemplateGrid.
2 answers

Sorting is not saved in the database, you have to either:

  • Use the sort Microflow as datasource for your List View on the page,
  • or sort the items in the List View itself. You can do that by retrieving the objects from XPath or Database and apply sorting.


Hope this helps!


you could try to make a helper-dataview (with datasource-microflow) in a dataview around your template grid.

Within the datasource, return the helper object with your sortedlist as a reference set. then within your template grid  follow the reference set towards your helper object.


This is quite a lot of work.

I prefer pedro’s solution to retrieve by xpath/db and a sort in the templategrid native sorting capabilities.