Using BREAK in For each in Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 04:00 AM
Hello Experts,
Just a generic question. Can we use break in "for each item in" in Flow Designer ? Because I can see that even if the particular record is found in a certain iteration, it is still moving into the next iteration till the last one.
But one catch is, I cannot use End Flow logic, since the for each is not the last item in my flow designer. There are other conditions and actions after the "for each".
Thanks,
Satanik
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 04:05 AM
Hi,
Did you try to explore Do Until action?
Do the following until flow logic
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 04:35 AM
Ok Ankur, Got it.
But there is nothing we can do in For each right ? Because I have a very long flow and changing every for each to do until is a lot of job.
But if there isn't any then will need to go with do until.
Thanks,
Satanik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2022 12:48 AM
Hi,
I don't think anything in For Each
Try to use Do Until
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2023 08:57 PM
Ankur, I don't think this is helpful, unfortunately.
I'm running into a similar issue where I have a returned JSON. Some of the records in the JSON are invalid. I want to detect the invalid ones and move to the next record.
I suppose I could create a separate subflow for the For ... Each processing, then "end subflow" when I catch the error, but this is already a complex process. I don't want to add more layers of subflows just to get a "next" or "break" function. Especially since they may need to exist at multiple levels of the process. It would move me from 3 layers to 5 or 6 very quickly, and I'd like to avoid that.