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

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

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

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (5,902)