Forum Discussion

Haniel Croitoru's avatar
Haniel Croitoru
Learn Expert
Jul 02, 2017

Automating Reminders for Approval Flows

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

 

Flow Initiation

 

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.
 

 

Caveats

 

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.

 

  • Hello Haniel CroitoruJim Duncan

    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 

  • Jim Duncan's avatar
    Jim Duncan
    Iron Contributor

    Very nice article, Haniel Croitoru and an excellent solution!

     

    I am considering using something similar for Project Change Requests; do you know if Approvals can be assigned to External Users?

     

    Thanks!

    • Haniel Croitoru's avatar
      Haniel Croitoru
      Learn Expert

      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.

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

     

    Joe

    • Varun Venkatesh Kumar's avatar
      Varun Venkatesh Kumar
      Copper Contributor

      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 . 

      • Joseph Collins's avatar
        Joseph Collins
        Brass Contributor
        I would guess your interval is rather short for testing purposes? Your interval has to be longer than your timeout.
    • Renee_Ricks's avatar
      Renee_Ricks
      Copper Contributor
      Can I use this flow if I have two approvers in my flow, like a manager and supervisor?
      • alanh1123's avatar
        alanh1123
        Copper Contributor

        Renee_RicksWhen you first choose the type of approval you want you can select whether it should be the first person that approves it or everyone has to approve it. I believe if you choose the second option, you should still be able to accomplish what you are looking to do.  

  • Tim Miller's avatar
    Tim Miller
    Copper Contributor
    Sorry to jump in long after everyone else. I am working on building a flow for Document review, part of wich is to send out reminders.

    I am using the Do until with the condition checking to see if a "review status" field in the list has been updated. I then have a delay 24 hours, thinking it will only send one email every 24 hours. I have it set to 1 hour for testing but only recieved 1 reminder email.
    Can someone explain to me how the timing works on the Do until?
    • Joseph Collins's avatar
      Joseph Collins
      Brass Contributor

      Hi Tim! 

       

      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: 
      https://docs.microsoft.com/en-us/flow/limits-and-config

       

      And here is another post you might find useful as it is similar: 
       https://powerusers.microsoft.com/t5/I-Found-A-Bug/Do-Until-only-works-for-1-hour/td-p/59849

       

      Cheers! 

      Joe

      • Tim Miller's avatar
        Tim Miller
        Copper Contributor

        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? 

         

  • Neeraj Bharti's avatar
    Neeraj Bharti
    Copper Contributor

    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.

    • Tim Miller's avatar
      Tim Miller
      Copper Contributor

      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. 

      • Tom_Gumbert365's avatar
        Tom_Gumbert365
        Copper Contributor

        Tim Miller I am attempting to set up an approval with timeout out and escalation, similar to what Jon did in the video. However upon timeout, the requestor receives a Rejection notification. The item is still escalated for a decision (and I added an email notification to the requestor that the request is being escalated). The end result though, is that the requestor receives 1) Rejection notification 2) Escalation notification. They do not receive the final decision (approval or rejection) notification that I was expecting. What I was expecting was 1) Escalation notification 2) Final decision notification. Your thoughts?

  • alanh1123's avatar
    alanh1123
    Copper Contributor

    Haniel Croitoruthank you for the helpful tut.

     

    I have setup my flow similarly to yours. My 'do until' condition works as scripted and sends the email reminder, however, when the individual then approves the request, the reminder email that was sent during the reminder step, gets sent again.

     

    Is there a way to terminate the reminder side of the flow once the notification email has been sent?

  • Arun_kingston's avatar
    Arun_kingston
    Copper Contributor
    The workflow has been approved , But still i got the remainder mail. Please help me to stop the remainder mail once it's approve or reject.
    • Joseph Collins's avatar
      Joseph Collins
      Brass Contributor

      Arun_kingston  Please post a pic of your DoUntil so we can see what you have going on.  Personally,  I would created a separate flow for the reminders and not make them a part of the dountil as a dountil has its limits and could timeout.  However, you could try putting the email as the first actions in the dountil such that:   

                            email>>delay>>get item>>checks for condition...   email>>delay>>get item>> etc...
      If the item is approved during the delay time period, it should not send the email after it 'gets item' and sees the condition is met. 

      • Arun_kingston's avatar
        Arun_kingston
        Copper Contributor

        Joseph Collins  Hi Jos , I want to stop the remainder mail once the action is done(Approve or Reject).

Resources