cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brian-C
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
Pstork1
Dual Super User
Dual Super User

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

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.

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
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,426)