Best practice to reverse list order.

0
Hi everyone,   I'm looking for the most efficient way to reverse the order of a list.   Is there a built-in function or best practice to reverse a list, or would I need to implement a loop manually to do this?Any suggestions or reusable module recommendations are appreciated!   Thanks in advance!
asked
2 answers
-1

Hey Anna,

 

There are 3 options:

- You can use this module: https://marketplace.mendix.com/link/component/117715

Attention: It's not Mendix supported and the last update was last yearimage.png

If you don't want to use this module, you can create your own Java action

 

- List can also be sorted descendent (this option only works if the list is already sorted)

 

- Using a loop: Iterate through a list and add to other list always the last object of the main one

 

Best Regards,

Ricardo Pereira

answered
1

You could do it in a loop. If you are allowed to use third-party modules, there is a JA_List_Reverse action in the Object List Operations module in the Marketplace that can reverse a list.

 

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

answered