Background
I've set up a nested loop, containing two loops in total, in a Flow:
If certain conditions are met while iterating through records in the loops, I would like the Flow to exit/break the loop (see A and B above). This is because the Flow has found what it's looking for, and no longer needs to continue iterating through records.
Questions
- Is it possible to break out of a loop in Flow Builder? Maybe using an Apex Action?
- If not, are there any issues with not terminating the outer loop, and
simply continuing the Flow until it ends?
- The inner loop must be terminated, otherwise it will not perform any iterations after the initial one. See Tim Shores' comment here.
Notes
- I wish to break out of the loop after finding what I'm after in order to make the Flow more efficient.
- I came across an idea related to this. Someone has suggested in the comments that you could break out of a loop by setting up a decision element inside it to ignore the loop element, and continue on with the Flow, which is how I've set up my Flow currently. However, as you may be able to tell, this doesn't actually terminate the loop.