cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Balony
Level: Powered On

do until loop runs only once

Hi everyone,

 

i have a problem, that my do until loop runs only once.
The concept is that flow starts at task item created, then send an e-mail with options to assigned people to complete the task from mail. But people can also complete the task form sharepoint, and in this case I want to terminate the flow, becaose it does not have to wait for the response from email.

 

In paralell branch is a send e-mail with options and a do until loop that cheks if the task still exist and it is not completed:
image.png

 

Here you can see, that the loop ran only once, the response to the mail was 13 minutes after.
image.pngrun

Why the loop runs only once?
Is there an other way to stop the flow to waiti to the email response?
After the response is a check that the task is alredy completed or not, but without the email response the flow will never end with the other branch?

 

Thanks for any advice.

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: do until loop runs only once

I think you may want the condition in your doUntil loop set to be equal to True, not False.  You pre-set it to False which means unless something inside the Loop changes the value of the variable the Loop will only run once. Normally you use a control variable in a Loop by pre-setting it to the value that will keep the Loop running.  Then when you want to exit the Loop you change the value of the control variable.  You're treating this like a Do While Loop rathter than a Do Until Loop.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Dual Super User
Dual Super User

Re: do until loop runs only once

It looks from the screenshot like you've adjusted the run after settings for some of the controls in the loop.  What are they set to?  In terms of the loop only running once.  There is a set variable in the main branch of the loop that sets the control variable to true.  If that runs the first time then the loop will only run once.  That's one of the items that has configured run after settings.  So you need to make sure the only set variable that is running is the one in the condition.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Balony
Level: Powered On

Re: do until loop runs only once

The first "set variable" is runnig if the get item fails (if item deleted),

the condition after is runnig if the "set variable" is skipped ("get item" success)

In this case the condition was false, all of the "set variable" actions were skipped.
image.png

Dual Super User
Dual Super User

Re: do until loop runs only once

I think you may want the condition in your doUntil loop set to be equal to True, not False.  You pre-set it to False which means unless something inside the Loop changes the value of the variable the Loop will only run once. Normally you use a control variable in a Loop by pre-setting it to the value that will keep the Loop running.  Then when you want to exit the Loop you change the value of the control variable.  You're treating this like a Do While Loop rathter than a Do Until Loop.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

Balony
Level: Powered On

Re: do until loop runs only once

You were right, I thought it's working like a do while loop.

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,455)