Just for the sake of knowledge, I'll let here some information about the ForEach that may be usefull.
The matter with ForEach is that you are forbidden connect ing the Cycle part with the exit part of the ForEach. So the following is not allowed:
![]()

But the following IS allowed.
![]()

As you can see above, the CYCLE of the ForEach and its EXIT are isolated.
How can we take advantage of this to execute a conditional looping in a list that can finish BEFORE the ending of the list, without duplicating code?
Passing the looping to inside a ServerAction, like this:
![]()

And than using this server action in my screen action (for example).
![]()

This way I can use a ForEach that do not run from the start to the end all the times, but can end before, depending on the condition (that can easily be a counter variable, for example).
Hope this helps.
Cheers.
Great "Visual" help for learning how to use correctly a ForEach loop.