In this SharePoint workflow tutorial, I will demonstrate how to create a leave request approval workflow using SharePoint designer 2013 in SharePoint Online Office 365.
In every organization, there is a need to follow a process to track leave history for employees. So here I am using a workflow to send approval to the manager for taking a leave.
For designing this SharePoint designer workflow, I am going to include three things here.
- SharePoint List ( Requesting for leave)
- Task list ( Create a task for approving or reject)
- Workflow History List (track all history of the workflow)
SharePoint designer 2013 leave request workflow
Below is how the leave request approval flow will work in SharePoint.
First, an employee creates a leave request in the SharePoint list. Then the request will go to her/his manager for approval. Then if the Manager Approves the leave request, then an Email is triggered to all stakeholders required. Workflow closes.
Create leave request workflow in SharePoint designer 2013
Step 1: Here I have created a list called “Leave request” in my SharePoint Online site. The list looks like below:
Step 2: Open SharePoint Designer 2013 and create a list workflow for the same SharePoint Online list.
Step 3: Enter the name of the workflow and choose SharePoint 2013 workflow platform type and click on the OK button to go ahead.
Step 4: Next, it will appear an empty page where you can start designing your SharePoint workflow.
Step 5: In this step, we need to edit Stage 1 to “Required Manager Approval” and set the approval status to click on the Action menu in a tab.
Step 6: Next set the message to “Pending manager approval” in message section in the action.
Step 7: Next add a log history to track your workflow logs so that we can audit it later.
Step 8: Next set due date of the approval by using action “Add time and date“.
Step 9: Create a workflow variable Due Date and add an action in order to add 5 days from the current date to the due date.
Step 10: Create a task where we will assign a task to a specific person for approval.
Step 11: Click the current item in the steps and add the manager name to approve the task in participant section.
Step 12: Next click on task title to add the request name as below screenshot.
Step 13:in description section add the details as per below image.
Step 14: Add the due date of task which we have set in previous step.
Step 15: Next go to the Email option and edit the email section in the task creation section.
Step 16:Next click on OK to go next step.
Step 17: Add a condition in the next step, check if the outcome of the task is Approved or Rejected.
Step 18: Net Set the workflow variable and value as approved in the step.
Step 19: Next log to the history list after task got approved and set the workflow status as approved and send an email to user as your leave is approved.
Step 20: Set the condition if your leave get rejected by your manager.
Step 21: Next end the workflow and publish it .
Step 22: Now the workflow is complete, click on the save button and then click on Publish.
You can get task list in Assign task list and by default history will save in Workflow history list but we can able to change the task list name and history list.
Step 23: Here I send an request myself as a manager and I got an email for approval.
Step 24: When the manager clicks on the link, the task will open where the manager can Approve or Reject the leave request.
Step 25: Once the user will click on the Approve button, Requester will get an approved email. The same for task rejection.
Step 26: you can also find the task details and workflow history details in below image.
Now the SharePoint Leave request approval workflow is ready. Then you can deploy SharePoint designer workflow to other production sites.
Create a Leave request approval workflow in SharePoint using Out of box workflow
Now, let us see, how to create a leave request approval workflow using SharePoint out-of-box workflow.
In every organization, there is a need to follow a process to track leave history for employees. So here I am using workflow to send approval to the manager for taking a leave.
For designing this workflow, I am going to include three things here.
- SharePoint List ( Requesting for leave)
- Task list ( Create a task for approving or reject)
- Workflow History List (track all history of the workflow)
Leave request approval workflow in SharePoint using Out of box workflow
- Employee creates a leave request in the SharePoint list.
- Request goes to her/his manager for approval.
- Manager Approves the request.
- Mail is triggered to all stakeholders required. Workflow closes.
Steps for creating a Workflow
Step 1: In this step, I have created a list called “Leave request” in SharePoint Online.
Step 2: For enabling content approval workflow, we need to follow the below steps.
- Click the Settings menu and choose the Site settings option.
- Click the Site collection features link in the Site Collection Administration group on the Site Settings page.
- Click the Activate button for the Workflows feature.
Step 3: Next go to the list properties and click on Workflow settings and add a workflow as per the below screenshot.
Step 4: Next choose the Approval- SharePoint 2010 workflow and choose the content type as this List. Next, provide your workflow name and task list where you keep your task. You can give a default task list or you can create your own task list to keep the information.
Step 5: Next choose the history list. As we know History list default it stored in the Workflow history list but we can also give our own list. Next Start the workflow automatically.
Note: Microsoft will disconnect the link between the task list and history list after 180 days of your workflow start date. As we know much organization they want to keep all information for audit purpose so here it would be better we will keep our task and workflow history in our different list as Microsoft only target to default task and history list which will not be creating any impact to our solution.
Step 6: Next provide your manager name whom you need the approval for leave. Next, you can also write the requested email inside the Request field. Next, give the Due date of your task. suppose your manager forget to approve it so SharePoint will remind through email till approval.
If you want to loop your HR in this flow then you can also provide HR email in the CC field. Next to Enable content approval.
Step 7: Most important things need to do here, before creating workflow we need to enable the Require content approval for submitted item to enable Yes. Otherwise, you will get an error while the workflow complete stage.
Step 8: Once you click on OK, it will redirect to your workflow settings page where you can able to see your newly created workflow.
Step 9: Next go to your List and send one new leave request to your manager.
Step 10: So that one approval request will go to your manager for leave approval.
Step 11: If you check the Workflow health, the status will show you as in progress because your manager not yet approved your leave.
Step 12: If your manager trying to approve your leave, then it will appear an Approve or Reject option as below image.
Step 13: Suppose your manager approved your leave, then you will notify through email.
Step 14: Next if you will check the Workflow history then it will show you all steps which has already been done in your Workflow.
You can also check the task list which is created after the workflow got approved. This is all about out-of-box leave approval workflow.
You may like the following SharePoint tutorials:
- How to call a flow from another flow in Power Automate
- Power Automate Set Variable
- Power Automate wait timer
- Power Automate update SharePoint list increment integer field
- How to move emails to folder after 30 days using Power Automate
- Power Automate list rows present in a table filter query
- Microsoft flow send email based on create date
Hope this SharePoint designer workflow explains how to create a leave request approval workflow using SharePoint Designer in SharePoint Online or SharePoint 2013/2016/2019.
Also, we saw how to create a leave request approval workflow in SharePoint using Out of box workflow.
Rajkiran is currently working as a SharePoint Consultant in India . Rajkiran having 7+ years of experience in Microsoft Technologies such as SharePoint 2019/2016/2013/2010, MOSS 2007,WSS 3.0, Migration, Asp.Net, C#.Net, Sql Server, Ajax, jQuery etc.He is C#Corner MVP (2 Times).