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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

Users online (20,103)