cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Need to loop Do until control (runs only once)

Hello, 

Need to loop Do until control, but it runs only once, and I don't understand the reason

I initiate var as True, the I set a control Do Until this var is True, but it goes only once, not infinity times.

Please help mesd.png

 

we.png

 

 
1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

@Anonymous 

 

As per the image that you have attached I see that you are setting value to the variable inside the DO UNTIL loop.

If we walk through the scenario on what is happening in the flow as per the below image. 

 

The flow will initiate the loop first, the condition is not checked for the very first time in the DO UNTIL loop this is common behavior for a DO UNTIL loop in all programming languages.

So, this will just ignore the condition and will pass to the action and the action you have specified is set variable value to true.

As specified the flow will set the variable value to true.

Then it will come back to the condition as it has not further actions to perform.

 

Now it will again the condition and here the condition is met as the value is set to true for the variable, so this will exit the loop.

 

This is how the flow is running only once.

 

If you want the loop to be run infinitely try setting value to the variable outside the loop itself.

Hope this information helps you with understanding the loop behavior 

 

If this information helps you, please hit the like button and mark the solution as resolved, so that it will help other users in future.

View solution in original post

1 REPLY 1
Microsoft
Microsoft

@Anonymous 

 

As per the image that you have attached I see that you are setting value to the variable inside the DO UNTIL loop.

If we walk through the scenario on what is happening in the flow as per the below image. 

 

The flow will initiate the loop first, the condition is not checked for the very first time in the DO UNTIL loop this is common behavior for a DO UNTIL loop in all programming languages.

So, this will just ignore the condition and will pass to the action and the action you have specified is set variable value to true.

As specified the flow will set the variable value to true.

Then it will come back to the condition as it has not further actions to perform.

 

Now it will again the condition and here the condition is met as the value is set to true for the variable, so this will exit the loop.

 

This is how the flow is running only once.

 

If you want the loop to be run infinitely try setting value to the variable outside the loop itself.

Hope this information helps you with understanding the loop behavior 

 

If this information helps you, please hit the like button and mark the solution as resolved, so that it will help other users in future.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (9,653)