Hey Anna,
The easiest way would be to sort the list (to reverse its order) and then use the list operation with the "Head" function to obtain the first object in that list.
You can read more about this here: https://docs.mendix.com/refguide/list-operation/
I hope it helps!
Hey Anna,
IMO Mendix currently doesn't offer direct implementation to retrieve the last element of the list. If you are in Mendix version 9.24.4+ then Mendix offers list operation "Range"
https://docs.mendix.com/refguide/list-operation/#range
With the help of this, you should able to get last inserted element. So in this case amount will be 1, and offset should be length of list -1.
If this not works, then you can go for lengthy method where at time of setting association you also maintain an order and then sort on it in descending manner and then get the first object.
Thanks & Regards,
Naman Khard
Thank you for your replies!