In my previous two articles i have explained about the basics of an approval flow and how you will create simple approval flow. If you did not see my previous posts then i would recommend you to see my previous approval series Part 1 and Part 2 before proceeding further.
Use Case-
When user will create one leave request in SharePoint Leave Management List, it will go for approval to his/her manager. Once manager approved/reject we will notify to user for their leave request along with manager comments. Comments are important when manager rejects approval request and requestor get to know why his/her request gets rejected?.
SharePoint List-
My SharePoint List has following schema-
- Employee ID – Single line of text
- Employee Name – Person type
- Leave Start Date-Date type
- Leave End Date-Date type
- Total number of leave days- Calculated column (=[Leave End date]-[Leave Start Date]+1)
- Employee Manager-Person type
- Leave Status-Choice type
- Comments- In case manager want to share some comments.
Now we will design our flow step by step.
Steps-
- 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.
- After trigger you will initialize one string variable- VarComments. We will use this variable to store manager comments and later we will update our SharePoint list comments column.
- After variable initialization, you will add all required steps as shown below-
- After approval action you will store comments in variable- VarComments. To do so you will append all responses by using Append to string variable action.
- In case of multiple approvers, Press enter after adding response comments in Append to string variable so that each approvers responses are clearly visible to employee.
- Now update your SharePoint List Comments column. In update item, pass variable(VarComments) in Comments column as shown below.
- In case you need to add comments in employee’s email then pass variable(VarComments) as shown below-
Now you have design your flow and before testing this do not forget to save your flow. 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.
Once approval flow ran successfully and request rejected by manager, you will be able to see comments in your SharePoint list-
Comments in employee’s email-