For Each loop exits after the 1st run - Flow Designer

Anish Reghu
Kilo Sage
Kilo Sage

Dear all,

Find the Flow design first.

find_real_file.png

After Send Mail 3.2.3 is END.

Then the following:

find_real_file.png

Note that there is no END flow logic applied here after 3.3.2.3 expecting that the for loop should not terminate in case of multiple iterations, BUT THAT DOES NOT HAPPEN. THE FOR LOOP ONLY EXECUTES ONCE EVEN AFTER REMOVING THE END LOGIC FROM HERE.

How do I get the FOR EACH logic to execute through all it's iterations. If a wait logic has to be applied, where should it be?

 

 

1 ACCEPTED SOLUTION

So it shows that it reaches an End-flow logic. Can you remove that End and try again?

End flow logic is used to: stop a flow within flow designer.

https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/flow-designer/concept/f...

View solution in original post

6 REPLIES 6

Willem
Giga Sage
Giga Sage

Can you share a screenshot of the Flow execution?

find_real_file.png

find_real_file.png

This should have run for 2 iterations:

 

find_real_file.png

But has generated only one Create record in response.

find_real_file.png

So it shows that it reaches an End-flow logic. Can you remove that End and try again?

End flow logic is used to: stop a flow within flow designer.

https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/flow-designer/concept/f...

Works! What happened is here...

I was looking at the Flow execution, expecting the For loop number to change from 1 to 4 since there are 4 iterations provided, but it was never changing!

find_real_file.png

It is only after I clicked the field that I realized that we have to change the iterations manually to check if it is completed. Expected too much I guess...

So, the learning is that the iteration number does not change on its own. We have to manually change and check it. That's number 1.

AND THE MOST IMPORTANT PART - Never to use End logic unless and until you mean to END OF FLOW and you expect no other operations to be done.

Thank you for guiding!