How to return to a previous step? - Flow Designer

Leonardo Chavez
Kilo Contributor

Hi SNow community,

i have a scenario that if the condition of the if statement is false it should return to a previous action/step, this in Flow Designer. Have searched for an action but didnt find anything.... is there someway to accomplish this?

Thanks in forwards!!!

1 ACCEPTED SOLUTION

Hi @Leonardo Chavez 

In case you think I was able to answer your question, I would be happy if you mark the appropriate response as "correct" so that the question will appear as resolved for other users who may have a similar question in the future.

If not, please tell me what you are still missing!

Many thanks & kind regards
Maik

View solution in original post

3 REPLIES 3

Maik Skoddow
Tera Patron
Tera Patron

Hi @Leonardo Chavez 

the short answer: it is not possible.

The reason is, that this could cause infinite loops. We have that scenarios with Workflows which can become very complex without reaching a final state.,

Kind regards
Maik

Hi @Leonardo Chavez 

In case you think I was able to answer your question, I would be happy if you mark the appropriate response as "correct" so that the question will appear as resolved for other users who may have a similar question in the future.

If not, please tell me what you are still missing!

Many thanks & kind regards
Maik

Wayne C
Tera Contributor

You can do this using a Flow Variable and Do Following Until.

Create a boolean Flow Variable called "Continue" and use the Flow Logic option "Set Flow Variables" before the start of the Do Following section to set the value of Continue to False. 

Add Flow Logic "Do following until" after setting Continue to False. Within "Do the following" section add your step to be repeated followed by your check (If Statement is True). In the Then section of your If, add a "Set Flow Variables" setting Continue = True.

For the "until" node it's just one Condition: (Flow Variables â–º Continue) is True.

This will cause the Flow to loop through the repeated step and your check until the "Continue" Flow Var = True (which only gets set once your check passes).

 

Be warned though: this can easily cause an infinite loop. Use "Do following until" sparingly and wisely.