cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Balony
Frequent Visitor

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.
runrun

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
Pstork1
Dual Super User III
Dual Super User III

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
Pstork1
Dual Super User III
Dual Super User III

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.
Balony
Frequent Visitor

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

Pstork1
Dual Super User III
Dual Super User III

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
Frequent Visitor

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

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Solution Authors
Users online (1,963)