Jul 02 2017 11:51 AM
Jul 02 2017 11:51 AM
Microsoft has recently introduced Approvals to Flow. This functionality provides users with an easy way to look at all their outstanding approval requests and action them.
But what if you don’t know that you have pending approvals? In this article, I provide an example how to receive time-based reminders of an outstanding approval until it has been actioned. In my example, I created a SharePoint list for vacation request that need approvals. The vacation requests have a requester, approver, start and finish date, and approval status. When the approval is first created, the Approval Status is set to Pending. (NOTE: Due to a current limit in the Flow functionality, I am leveraging a text field for the Approval Status rather than a choice field or other structure data).
Once a vacation request has been submitted, the flow kicks off. Let’s have a look at how it works.
The flow is broken into three major sections
During the initiation of the flow, information is captured about the vacation request, such as the name of the requester and approver. As well, I create a variable Approval Provided, which I use later to determine whether approval has been provided or is still pending.
The next two sections run in parallel branches.
Flow Approval (right branch)
In this section, I submit an approval to the approver mentioned in the SharePoint Vacation Request list item. As this step is synchronous, the right branch will pause until the approval step has been completed by the approver by either approving or rejecting the vacation request. Once an action has been performed, the original SharePoint Vacation Request list item is updated with the corresponding Approval Status.
Reminder (left branch)
The left branch is responsible for sending out email reminders to the approver. The trigger is time based and continues until the Approval Provided variable is set to true (which happens in the Flow Approval branch). To make things easier for the approver, I am including a link to the Flow Approvals page (https://flow.microsoft.com/manage/environment/<your tenant ID>/approvals/received) directly in the email message.
There are a couple of caveats with this approach. The first one is that you cannot target a specific approval for your user. If the user has several approvals outstanding, you will need to be creating in your messaging to ensure that they address the correct one. For example, in my email message above, I have included the approval type (Vacation Request), who requested it, and start and end dates. These can be matched to the Approval information.
The second caveat is that unless you put a limit on the reminders, they will continue until the approval has been actioned. This can possibly a point of annoyance if someone is away for some time and comes back to find a long list of approvals in their mailbox.
Jul 06 2017 07:26 PM
Hi @Jim Duncan,
Thanks for the feedback. I looked into your specific scenario and what I found was that it's not possible for the reason that each approval is associated with a specific tenant ID.
When you are creating an approval, the approval link in the email points to your tenant's Flow Approval page (e.g. https://flow.microsoft.com/manage/environments/Default-your_tenant_id/approvals/received) . When an external user clicks this link in the email, they would get a 404 error as that page does not exist on their tenant.
One work-around would be to provide a regular email with more details to them and possibly manage the approval through another mechanism, such as SharePoint. A similar approval process could be introduced for that case.
Hope this information is helpful for you.
Dec 01 2017 03:16 AM
I tried the workflow u described.
It is as i wanted to implement in my project.
But what i want is that user will not get a single mail about reminder when the approval is done.
In this case, user gets atleast one mail even if the approval is given in mentioned amount of time.
How can i achieve that??
Any help is appreciated
Jan 03 2018 05:42 PM - edited Jan 03 2018 05:50 PM
This was almost identical to what I was needing so i set my flow up to be the same. the only difference is that my Do Until is on the right side instead of left and I put the set variable to true after my Condition statement after starting the approval. The flow works fine except the reminders never stop coming. It's like it doesn't see the variable is set to true for some reason. I've tried butting the set variable above the Condition, in the condition and after it. I found that the Do Until variable is equal to should be just "true" and not "bool('true')" and that made it work just fine. Thank you!
Jan 14 2018 11:51 PM
I did create exactly the same flow and it works perfectly except for one thing. The do until flow runs for one last time after I approve the request and the approval variable is set to true. Technically the do until loop should not run when we approve the request and the approval variable is set to true, but somehow the loop runs one last time and send me a reminder email and closes the flow. Can someone help me understand if i am missing something here .
Jan 16 2018 02:11 PM
Jan 24 2018 04:15 PM - edited Jan 24 2018 04:16 PM
My apologies for such a quick first reply... I now know what you mean now and fortunately I think I've found the solution. The logic in this flow is missing an important step. You see, since the Do Until is running in parallel with the Start Approval, it Must complete at least one delay loop as there is nothing telling it otherwise. Once the Do Until is started it doesn't know the condition of the Set Variable until it is done sending the email. Sooooo... there needs to be a Condition between the Delay and sending the Email. Of course you need a column in your list to compare. I have a column called Approved and it is set to Pending when item is first created. Then set to Yes if Approved and No if Rejected. My Condition says to check this column and if it is still set to Pending, THEN send the Email. I've attached what it looks like and I really hope it works. Let me know what you find! - Joe
Jan 30 2018 12:32 AM - edited Jan 30 2018 01:26 AM
Hi, I am sorry for the late reply. Had some busy time at office and couldnt come back here and give you an update.
I tried your first advise and yes it did work but the Do Until loop just could run once and sent only one reminder and completed the flow. I was not able to use this to send multiple reminder for the same request.
On the other side, As you suggested in your latest reply, I added a condition just after the delay. I had no issue testing however only one reminder email was sent out after 10 min delay and completed the DO Until flow. There was no second reminder sent out. I am not sure is I am doing anything wrong here.
Is there a way we can make this do until loop run and keep sending the reminder until I approve the request.
Thank you in advance.
Feb 05 2018 02:26 PM
Unfortunately this didn't work either. It simply chooses to continue running the first pass of the DoUntil regardless of the status. I even got MS on the phone and they couldn't not resolve. But not to fear, the next best solution was to simply remove the DoUntil in the first Flow and create a separate Recurrence Flow that checks the list every two days for items still in "Pending" status and then send out a reminder on those. See my image attached. This has been working just fine for me now. I just don't think the DoUntil is 100% up to par yet.
Feb 09 2018 01:34 AM
That flow worked beautifully. Thank you very much for the help.
Jun 06 2018 08:41 PM
Jun 07 2018 09:58 AM
In short, the DoUntil has the "Change Limits" button under it which controls how long it runs:
Count = seconds and a max of 5000
Timeout = in ISO format and max of 30 days
The Defaults are 60 seconds and 1 hour (PT1H). So that explains why you only received 1 email. It stopped by the default after 1 hr.
The flow will stop based on whichever limit it reaches first. Adding a Delay action is a good idea to extend how long the flow waits for the dountil to resolve but you also have to extend the limits so that your delay doesn't fall outside those limits.
Here is a link to the technical limits of the DoUntil:
And here is another post you might find useful as it is similar:
Jun 07 2018 10:24 AM
Here is a screen shot of my do until. basically i want it to send the email then a reminder a day later if the SharePoint item "Review Status" does not equal Assigned. I tried to use the contains 1st reviewer where the list item would either be 1st reviewer completed or 1st reviewer declined, didnt work.
If i am understanding this correctly, I should get an email every 10 min until the list item is changed from assigned. that would continue for 7 days with P7D as the timeout. Is the count (60 seconds) how often it checks the list item then?
Jun 07 2018 11:20 AM
ok, this is saying that it will send the email every 10 min but for only 7 days or 60 tries (whichever comes first). Since there are 6 10min's in an hour, you will get 6 per hour... this will happen for 10 hours until 60 attempts have occurred (assuming it only takes a second to send the email, but yes, if it took 2 seconds to send each one, you'd get 30; depends on server, etc.)
Jun 11 2018 07:31 AM
@Haniel Croitoru, Nice article ! Is there a way we can track who has approved when there are multiple approvers and ALL must approve in order for the request to move to Approved state. I want to send reminder to only those who haven't approve yet.
Jul 13 2018 08:50 AM
I ended up changing my Flow to a time out and send again like what Jon demonstrates in this video. https://www.youtube.com/watch?v=U4iuVi1Vtgg&t=1s
Basically my first approval times out in 3 days, then the second one runs after the time out. I couldnt get it to send out the first email until after the delay was met so a day later.
For the tracking who has approved, I used the Update Item to write the response to a column in the share point list.