Shamma Negi
Kilo Sage

Hi All,

 

Today I would cover what is "Exit Loop flow logic" in ServiceNow.

This is recently launched in Washington DC Release.

 

Features:

It exists from a flow logic loop when the conditions of an If flow logic are met. It allows our flow to continue running from the next step after the flow logic loop. This flow logic is also known as "break".

 

You can only add Exit Loop flow logic within certain part of the flow. The Exit Loop flow logic must be within a branch of a parent For Each or Do the following until flow logic block.
  • Then branch of an If flow logic block
  • Then branch of an Else If flow logic block
  • Then branch of an Else flow logic block

 

Execution Details

When our flow exits a loop, the state of the exit logic becomes Completed. 

 

Example 1: Exit a loop based on incident count

In this example, it is shown how a flow generates a list of incidents assigned to a user. For each incident that is assigned to the user, the flow sends an email. If the list of incidents is greater than or equal to 5, then the flow exits the For Each flow logic loop and doesn’t send an email.

 

In a similar way you can use this flow logic for any such scenario wherein you want to exit the loop at some condition.

 

 
ShammaNegi_1-1707219002194.png

 

For more information on Exit Loop, Do checkout the ServiceNow docs below:

This content is also picked up from ServiceNow Docs.

https://docs.servicenow.com/bundle/washingtondc-build-workflows/page/administer/flow-designer/refere...

 

Hope this helps you. Do mark this article helpful if it helped you in any way.

 

Regards,

Shamma Negi

1 Comment