Using BREAK in For each in Flow Designer

Satanik1
Giga Guru

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

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Did you try to explore Do Until action?

Do the following until flow logic

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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.