cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

Do Until - Reminder email until the condition is met

Hello,

I have a SharePoint list form customized using the Power Apps form. In the back-end, I have a flow that will trigger once the item is created and after that, an email will be sent to the approval to approve (within the Power Apps form, so I am not using send an approval action).
After the user receives the email, I have added a "Do Until action" that checks if DM (Direct Manager) field in SharePoint is approved or rejected. Once the field is updated to the approval response it should be escalated to another approval.

The problems are the following:

  • The first problem is that the user receives 60 emails at a time. Maybe, because the Count is 60 but the Timeout of the Do Until is PT3M and for the "Send an email action" is PT2M (every 2 minutes, To remind the user to approve if he has forgotten).
  • The second problem is that the Do Until action runs successfully without checking for the condition whether if it's approved or rejected and it gets escalated to the second approval.

What I want to achieve is the following:

 

  • I want to send an email to the user and remind him each and every 2 days (P2D) if he didn't take any response (approve or reject).
  • I want the Do Until action jump to another step (approval) once any of the conditions is met (Approved or Rejected) or has timed out.

I have used the following condition inside the "Do Until":

@or(equals(triggerBody()?['DirectManager']?['Value'], 'Approved'),equals(triggerBody()?['DirectManager']?['Value'], 'Rejected'))

 

Please have a look at the flow result screenshots:

Capture.JPG

Capture1.JPGTrigger resultTrigger resultCapture3.JPG
The value returned from the DirectManager field is open (This is a default value when the item is created), and I am mapping this field value inside the Do until condition.

What is the best way to achieve the above scenario?

Can please someone provide an example and explain it in detail?

Any help will be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Julien2

 

The problems are the following:

  • The first problem is that the user receives 60 emails at a time. Maybe, because the Count is 60 but the Timeout of the Do Until is PT3M and for the "Send an email action" is PT2M (every 2 minutes, To remind the user to approve if he has forgotten).

For the first issue, please take a try to add a Delay action inside the do until so the Do until wouldn't send the 60 emails quickly.

 

 

  • The second problem is that the Do Until action runs successfully without checking for the condition whether if it's approved or rejected and it gets escalated to the second approval.

For the second issue, you should add a "Get item" action inside the Do until to get the new item data, and you should use the DirectManager Value dynamic from the "Get item" action in the Do until and the Condition, instead of use the dynamic from the trigger, since the trigger data would be same not the newest data.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
Community Support
Community Support

Hi @Julien2

 

The problems are the following:

  • The first problem is that the user receives 60 emails at a time. Maybe, because the Count is 60 but the Timeout of the Do Until is PT3M and for the "Send an email action" is PT2M (every 2 minutes, To remind the user to approve if he has forgotten).

For the first issue, please take a try to add a Delay action inside the do until so the Do until wouldn't send the 60 emails quickly.

 

 

  • The second problem is that the Do Until action runs successfully without checking for the condition whether if it's approved or rejected and it gets escalated to the second approval.

For the second issue, you should add a "Get item" action inside the Do until to get the new item data, and you should use the DirectManager Value dynamic from the "Get item" action in the Do until and the Condition, instead of use the dynamic from the trigger, since the trigger data would be same not the newest data.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hello @v-alzhan-msft ,

Thanks for your suggestions.

The first problem was solved, but unfortunately, the Do Until action runs successfully without checking for the condition whether if it's approved or rejected and it gets again escalated to the second approval, knowing that I have used a "Get Item" action and mapped the "Direct Manager Value" inside the Do until condition to check if it's "Approved".

 

Please have a look at the below screenshots:
Capture.JPGCapture2.JPG
Any suggestions to solve the second problem issue?

Looking forward to your response.
Thank you!

We are having very similar issues and would like to see how you resolve yours.

We have a list in SharePoint, where we want to send alerts/approval emails to a staff member. If they dont change the status of the item in SharePoint, it sends a reminder every day until they do.

The sending of the emails appears to work correctly but changing the status makes no difference and the Flow doesnt pick up the changes value. We have added in Get Item but it still returns old data.

Hello @Browncdt ,

I have resolved my issue by implementing the following:

  • Set the Timeout to PT10M (for testing purposes)
  • Set delay action to 1m (for testing)
  • Add your send an email or approval action, configure the settings of the approval action, and set the Timeout duration to PT1M (To remind him every minute).
  • Add a Get item action and map the Id from the Trigger.
  • Make sure you have selected the FIELD VALUE from the Get item to get the latest data from the Get item after the approval reminder.

After these steps, you can set the next action that is outside the do until action to run after Do until has succeeded or has timed out.

Please consider taking a try with the above solution, then check if the issue is solved.

Thank you!

Many thanks for the quick reply. This is what I have in place currently; (Lead/Owner is a user picker and can be multiple people)

flow.PNG

Basically I have a dropdown list (Status) that I am trying to get the updated value of. But the new value doesn't seem to get picked up.

Thanks again.

Hi @Browncdt ,

Could you please hover on Status Value inside the Do until and send me a screenshot?

Besides, try to put the Get-Item action outside the apply to each loop and test again.

Thank you!

Many thanks.

 

Yeah moving it doesnt appear to make any difference.

This is my Status Value hover. This is from a Choice column Default of 'New'.

Browncdt_0-1593168613405.png

 

Hello @Browncdt ,

Thank you for providing a screenshot.

As I can see the Status Value is mapped from the TriggerOutputs and not from the Get-Item action.
As a fixed solution please make sure you are mapping the Status Value from the Get-Item action:
Capture.JPG
Let me know the output result based on what I've mentioned above.
Thank you!

Brilliant thank you.

 

I think that might have done the trick. My Flow now goes through the Succeeded phase. I think I still have a bit of tinkering to do, but that seems to do what it should.

 

Many thanks for your help!

Hi @Browncdt ,

You are the most welcome, if I have answered your question then please consider Accept it as the solution to help the other members find it more.
Capture.JPG

Have a nice weekend!

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Microsoft Ignite

Microsoft Power Platform: 2021 Release Wave 1 Plan

Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (51,008)