Reverse list

Hi,   I need to reverse a list of entities in a microflow. The change list activity does not provide a functionality to add something to the beginning of the list.   So far I created a java action that reverses the list but I would need to do that for any type of entity.   Is there a “Mendix way” to do that?    
2 answers

The Object List Operations module from Mendix allows you to move an object around a list. This means you can add as usual and then move the object to the beginning of the list.

I hope this helps.




A Java Action is also the Mendix way. Lists can be sorted using the List Operation Action. That is, of course, only the answer if the list was sorted in the first place.


You can create a loop over the list and grab the tail of the list using the List Operation Action and add that object to a reversed list, then subtract the tail from the original list, count the list etcetera:



The wat to reverse the sort order:


Go Make It