In my previous article, I have explained about approval process. Now we will see how to create a simple approval flow using power Automate/Flow.
When user will create one leave request in Leave Management List, it will go for approval to his/her manager. Once manager approved/rejected we will notify to the user and update leave status on SharePoint list.
SharePoint List- Leave Management
- My SharePoint List has following schema-
Now we will design one Approval Flow which will be triggered when a new item is created in Leave Management list.
- Go to this link–> Then Login with your credentials–> Click on +Create –>Choose Automated Cloud flow–> Give flow name and select trigger When an item is created.
- Once you have clicked on Create button, configure your trigger by selecting site address and list name from the dropdown as shown below.
- If you want to show end user leave request status as “Pending”. For this there are two ways to achieve this-
- First: Go to your SharePoint list then edit Leave Status column and then set Leave status column default choice as Pending
- Second: you can use one Update item action in your flow to set leave status value as “Pending”. Here you need to select ID from dynamic content of When an item is created.
You can choose either one as suits you.
- After trigger we can directly use an approval action. But it is good practice to notify end user once request is submitted successfully. So, we will add one Send email action which will be just the confirmation for end user. Please configure your send email action as shown below-
- Now we will add one approval action and configure as shown below. Here you need to give manager email from dynamic content.
- After this you need to add condition action and check whether Manager has approved/rejected the request. In Condition action- Left side you need to choose outcome from dynamic content and in right side just type Approve (this is case sensitive).
- Now you need to update user for the approval outcome. First update approval status in SharePoint list and then send email to user. Configure your flow as shown below-
- Once this is configured, click on save to save your flow. After saving it will display green message at the top.
Analyzing The Approval Flow
- Now you have designed and saved your flow. You need to test this. For testing go to your SharePoint list and click on to create one leave request. After couple of minutes (as per your flow license) you will see your flow is running.
- Click on link under Start tab as shown above, You will see your flow is waiting for manager approval.
- After manager approval it will update Leave Status column value in SharePoint list and then notification will be sent to user.
Adding second level approval–
Some time you need to add one more level of approval. In this case, you will add all the steps from approval action to the end of the flow under Yes block as shown below.