Select Item from a list to start the loop

0
Hi all, I have a list with Items, I want to loop over. However I only want to start the loop from the 5th element of that list. Right now, I substract the items from the list making a list operation within another loop. But that way I need to create a new list to be able to use it in the next loop. Is there a possibility to loop over a list from a fixed starting position or a possibility to skip some items from a list eg continue in C#?   Many thanks!
asked
2 answers
5

Mendix doesn't really support this: the assumption is that you want to execute the logic for every element of your list. However, you can build it as follows: you could add a counter variable (initialized at 0) before the start of the loop. Then, in the loop you add one to the counter and go to an exclusive split ($Counter >= 5) then do you logic, otherwise you go to a continue event.

answered
1

If possible, you could also try to only retrieve the objects you need. But depending on your usecase (persistable, non-persistable, not yet committed,...) it could be that this is not possible.

answered