Request Manager Approval for Leave Requests TemplateIn the latest installment of "The More You Know Flow" I will be covering the Request Manager Approval for Leave Requests Flow Template. In my work as a consultant, one of the most consistently requested things I see is to create an automated process for PTO requests. I've built several leave request workflows in our old friend SharePoint Designer back in the B.F days (Before Flow). Thankfully, Microsoft has realized the need and provided us with an easy to use Flow template for automating the leave request approval process.
Set UpBefore we get started there are a few things we need to understand and set up.
1) This template assumes you have a SharePoint list set up to track Leave Requests. It uses a new item being added to this SharePoint list as the trigger to kick off the Flow. I used the Custom List template and just added two date fields for "From" and "To" to mark the dates the person is requesting off. I added one additional field for "Request Type" that is a choice field with options for PTO, Sick, Jury Duty, etc. You can customize your list however you like just make sure it's there before you set up the Flow.
2) It is going to look up the manager you have defined in your user profile so if you don't have that defined it won't work.
ConfigureFirst step to create this workflow is to locate the "Request Manager Approval for Leave Requests" Template in Flow:
|Figure 1 - Flow Template|
Once you select the template you'll be taken to the screen to connect to all the required data sources (Outlook, SharePoint, O365 Users). Configure your connections and click continue.
As you can see the Flow template is fairly simple:
|Figure 2 - Flow Configuration|
It's triggering off a new item being added to SharePoint, then it's getting the profile information of the user who submitted the request. Next, it will look up the manager for that user then it starts the approval process. That approval process is sending an email to the manager. Next, it is looking for the response (did they click approve or reject) and sending an approval or rejection notice to the user that requested the time off.
The only thing that you are required to fill out to get started using this template is Site URL and List Name of your Leave Request list in SharePoint in the "When a New Item is Created" Step. And the "Item Link Description" in the "Start an Approval" Step.
|Figure 3 - Item Link Description|
For the Item Link Description I'm just taking the Request Type and Start and End Dates from my SharePoint list and using concat to put all those together:
Once you fill out the required information you can save and test your flow. Here's what the approval email to the manager will look like:
|Figure 4 - Approval Email to Manager|
Once the manager approves then the user that requested the leave will receive an email that looks like this:
|Figure 5 - Approved Notification to Requestor|