Reverse list

0
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?    
asked
2 answers
1

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.

 

https://marketplace.mendix.com/link/component/117715

I hope this helps.

answered
1

Hi, 

 

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

answered