Hello Workato Community,
Is there a way to exit a ForEach loop given a specifc condition (like in a WHILE statement)?
I'm just looking for an ID in a list and I want to stop the ForEach once the ID is found.
I added an IF condition inside the ForEach but, as per my understanding, this would just prevent the following steps inside the ForEach from being executed, but the ForEach would still need to iterate through the whole list.
sometimes the .where function can help prevent unnecessary loops.
I also echo Vinny, as an engineer I hate wasting electrons but a simple if statement also gets the job done. I have tried many different ways of breaking a loop in Workato and it didn't work out well - so now I just keep it simple.