Add list to list

3
If I retrieve a list with 'Payments' with a boolean 'true'. Sorted by 'Name'. Payment;Boolean;Name Payment1;true;ALK Payment2;true;BOH Payment3;true;CBI Payment4;true;KLM After this I retrieve a second list for 'Payments' with a boolean 'false'. Sorted by 'Name'. Payment;Boolean;Name Payment8;false;HJB Payment12;false;ZBU If I add the second list to the first list, can I assume that the list will be in the order I put it in and stays like that. Like: Payment1;true;ALK Payment2;true;BOH Payment3;true;CBI Payment4;true;KLM Payment8;false;HJB Payment12;false;ZBU or will the order of the list be messed up? //Edit Renamed Payment names in the second list so that it is clear that all objects in both lists are different objects
asked
3 answers
4

It appends all of the elements that you're adding to the list at the end of the list, so your assumption is correct, the result will be in the following order:

  • Payment1;true;ALK
  • Payment2;true;BOH
  • Payment3;true;CBI
  • Payment4;true;KLM
  • Payment8;false;HJB
  • Payment12;false;ZBU

Note, however, that this order might not be preserved if you save it in a referenceset. I can only guarantee that it'll remain in this order during a microflow.

answered
1

A list is a set in Mendix so adding the same objects will not help. So unless Payment1 and Payment1 are not the same Object nothing will happen. Furthermore because it is a set i don't think the order will be saved but i am not sure on that one.

answered
0

I'm sorry for the confusing example. I'll edit it in my starting post.

the Payment column is just a simple string field. So all the objects in both lists are different objects.

answered