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

Do Until and Delays - Loop running 1 extra time

Hello,

 

I have a flow that uses delay to remind individuals if they have a pending approval. If they still have not submitted a response after a predetermined period of time (45 seconds here for testing purposes), the the flow sends them a reminder email. In theory, I think I had the logic down, however in practice what is happening is that the do until loop is running 1 extra time even after a person approves.

 

Here's the breakdown of what happens:

 

  • A status variable is set to 'Waiting' to indicate approval is waiting for action
  • Approval message is received by individual. At the same time, a parallel branch begins running the reminder logic
  • 45 Seconds pass without action, flow starts sending reminders
  • Individual takes action on approval at some point
  • Next flow step sets status variable to 'Entered', which is the exit condition.
  • At this point, even though the variable is now 'Entered', one more reminder email gets sent out even though action has already been taken. This should not be the case.

Here is what the structure looks like:

 

loop.png

 

What can I do to correct this behavior? I think I'm missing something, possibly as to when the status is checked.

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User II
Dual Super User II

Re: Do Until and Delays - Loop running 1 extra time

Move the timer above the status check condition that checks for Waiting and use that condition only for sending the email.  I suspect what is happening is that the condition checks the status and then starts the timer while it is still waiting.  while the timer is pending the flow changes the status to entered, but the flow will still send one more email since its already in that branch of the condition.  If you put the timer above the condition it will check the status just before sending the email and only send it if the status is still waiting.



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

2 REPLIES 2
Highlighted
Dual Super User II
Dual Super User II

Re: Do Until and Delays - Loop running 1 extra time

Move the timer above the status check condition that checks for Waiting and use that condition only for sending the email.  I suspect what is happening is that the condition checks the status and then starts the timer while it is still waiting.  while the timer is pending the flow changes the status to entered, but the flow will still send one more email since its already in that branch of the condition.  If you put the timer above the condition it will check the status just before sending the email and only send it if the status is still waiting.



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

Highlighted
Frequent Visitor

Re: Do Until and Delays - Loop running 1 extra time

Right. I suspected as much while breaking down all my steps to find out what was wrong. Had to move the delay timer out of the condition.  Seems to be the solution after a few tests. Thank you for the help!

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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!

Users online (7,366)