Recently, we have built a digital product using Power Automate where employees can request a product to purchase, and based on the price of the product, it will go through multiple approvals.
Once the approval is completed in every step, the employee will get notified about the product status.
It will go through below levels of approvals:
- Team Lead
- Manager
- Finance Team, etc.
You can check the entire flow in the diagram below:
Here is how the Microsoft flow works:
- Employee Submitted a product request (on the SharePoint Online list).
- An approval request will be created for the Team lead. If the Team lead rejects, the flow stops there. And the employee will get notified via email.
- If the Team lead approves, then if the Price of the product is greater than $10,000, approval will be created for the Manager. If it is less than that, an approval request will be created the for Finance team.
- If the manager approves, then the flow will create the next approval request for the Finance team, and if it rejects, the flow will be stopped. And everyone will be notified via email.
- If the Finance team approved, the employee and the external vendor will get notified to purchase the product. And if the Finance team rejected it, then the flow stopped there and everyone will get notified.
Note: If the Finance team does not approve the request within 2 days, then it will automatically be approved.
The entire flow looks like the below:
To achieve this Follow the below steps:
Step:1
Let us first create a SharePoint online list having the below columns:
- Employee ID = Default Title column
- Employee Name = Person column
- Employee Gender, Employee Role, and Employee Department = Choice columns
- Product Name and Product Price = Lookup Columns
- Product Quantity and Total Cost = Number type
- Product Color and Approval Status = Choice type columns
- Product Date = Date and Time type
The Screenshot below displays the Digital Purchase Order Approvals SharePoint list with the mentioned columns:
Step:2
- Log in to Power Automate with your Microsoft credential, click on the +Create option and select Automated cloud flow, and Enter the Flow name.
- Then select the flow trigger as When an item is created (SharePoint) and click on the create option as highlighted below:
Step:3
On the “When an item is created” flow action, provide the Site Address and List Name. Here I choose the list that I have created above “Digital Purchase Order Approvals“.
Step:4
- We will calculate the Total cost value = Product price * Product Quantity and then we will Update the calculated Total Cost Value in SharePoint List Using Update item action from the action triggers.
- For the Total cost column value, select the field and under Expression pass the below expression to multiply the price value with the product quantity. Click the ok or update option.
mul(int(triggerOutputs()?['body/Product_x0020_Name_x003a__x0020_/Value']),triggerOutputs()?['body/ProductQuantity'])
Step:5
- Now we will initialize a string variable named ‘VarOutcome‘ and we will use the initialized variable later in our flow to get the outcome of the value of the Finance Team and Manager.
- So, click on the +New step -> select Initialize variable action. Then provide the Name of the variable and the type of the variable as String.
Step:6
Select +new step and add the “Start and wait for an approval” action specifying to start of a Team Lead approval process. This action has below fields:
- Approval type: Select an approval type as “Approve/Reject – First to respond” from the drop-down.
- Title: Enter the title field value from the Dynamic content.
- Assigned to: Assign the email of the person who will approve/reject the requested product item.
- Details: Enter the details to Team Lead for the requested product from the Dynamic content.
Step:7
- Now we will add the Condition action to check whether the requested product is approved or not by the Team Lead.
- In this Condition action, select the Outcome (from Start and wait for a Team Lead approval action) value equal to Approve.
Step:8
- From the condition, if the outcome is not equal to approve, the Team Lead rejects the requested product.
- So here we will use the Update item action from action triggers to Update the Approval Status as Rejected in the SharePoint list.
And then we will email the requested employee using the Send Email action that the Product request has been declined.
Step:9
- From the condition, if the outcome is equal to approve, then the Team Lead approves the requested product.
- Now we have to check the condition using the condition action and if the Total Cost is less than or equal to $10000 then it goes to Finance Team for the second level of approval else it goes to the Manager team for approval.
int(outputs('Update_item')?['body/TotalCost'])
Step:10
- If the condition matches it goes to the If yes section for the Finance Team for the Approval.
- Select +new step and add the “Start and wait for an approval” action specifying to start of a Finance Team approval process for the Payment process for the employee-requested product. This action has below fields:
- Approval type: Select an approval type as “Approve/Reject – First to respond” from the drop-down.
- Title: Enter the title field value from the Dynamic content.
- Assigned to: Assign the email of the person who will approve/reject the requested product item.
- Details: Enter the details to Finance Team for the requested product from the Dynamic content.
- If the Finance Team didn’t approve or reject the product request within two days it goes for an auto-approval. To set auto-approval select the More options icon (…) in the start and wait for an approval action.
- Click on the setting gear icon and in the Timeout section, set the duration as PT2D and click Done as highlighted below:
Step:11
Now we will get the outcome of the finance team value, for that select the Set Variable action and select the initialized variable name (VarOutcome). In the value section pass the Outcome of the Finance Team.
For Auto_Approval Select Set variable action More options (…)-> Configure run after -> and select the has timed out option as shown below:
Step:12
Now we will add Condition action, to check if the outcome of the finance team is either approve or null.
Step:13
- If the condition matches then in if yes condition then we have to update the SharePoint list approval status as approved and send an email to the requested employee and also to the external user.
- Here we will add an Update item action from action triggers to Update the Approval Status as Approved in the SharePoint list.
- Now to send an email to the requested employee and the external user we will add a send email action, and in CC we will add the Team Lead and Manager to notify the requested product is delivered.
- I have added the email, body, and subject using the dynamic content values here. And for the external user id, I have passed the email account value manually.
Step:14
- From the condition, if the outcome is not equal to approve, the Finance Team rejects the requested product.
- So here we will use the Update item action from action triggers to Update the Approval Status as Rejected in the SharePoint list.
When it is rejected, we will email the requested employee using the Send Email action. Also in CC, we will add the Team Lead and Manager to notify them the requested product has been declined.
Step:15
- For step 9, If the condition doesn’t match then it goes to the If No section, and approval will be created the for Manager.
- Select +new step and add the “Start and wait for an approval” action specifying to start of a Manager approval process. This action has below fields:
- Approval type: Select an approval type as “Approve/Reject – First to respond” from the drop-down.
- Title: Enter the title field value from the Dynamic content.
- Assigned to: Assign the email of the person who will approve/reject the requested product item.
- Details: Enter the details to Manager for the requested product from the Dynamic content.
Step:16
Now we will get the outcome value of the Manager, using the Set Variable action and select the initialized variable name (VarOutcome). In the value section pass the Outcome of the Manager.
Step:17
- Now we will add the Condition action to check whether the requested product is approved or not by the Manager.
- In this Condition action, we will check the variable that has an outcome of the manager value is equal to approve or not.
Step:18
- From the condition, if the outcome is not equal to approve, the Manager rejects the requested product.
- So here we will use the Update item action from action triggers to Update the Approval Status as Rejected in the SharePoint list.
When it is rejected, we will email the requested employee using the Send Email action. Also in CC, we will add the Team Lead to notify the requested product has been declined.
Step:19
For step 17, if the Manager approves the approval request, then it will create an approval for the Finance team. And you can just follow the For Finance team approval like above (from Step 10 to Step 14 ).
Step:20
- Now our Digital Purchase Order Approval flow is ready. So we can save and test the flow.
- To test the flow, select -> Manually -> Test
Create a new list item in a SharePoint list as below:
The team Lead will receive an email to approve or reject the product requested by the employee. Here we will test the Team lead Rejection flow, so the team lead will simply select the Reject option as highlighted below:
The below screenshot, below displays our Digital Purchase Order rejection flow ran successfully.
Now in the SharePoint list, we can see the requested item approval status has been updated as Rejected.
When the product request is rejected, the employee will get an email as below:
Now, in the same way, we will create a new list item in the SharePoint list to test the Multilevel approval flow.
The team Lead will receive an email to approve or reject the product requested by the employee. Here we will test the Team lead Approval flow, so the team lead will simply select the Approval option as highlighted below:
The Second level of approval goes to the Finance team, they can either Approve or Reject. so here we will select an Approve option.
The below screenshot, below displays our Digital Purchase Order Approval flow ran successfully.
Now in the SharePoint list, we can see the requested item approval status has been updated as Approved.
You can download the entire solution from here:
When the product request is approved, the employee will get an email as below:
You might also be interested in the following Power Automate tutorials:
- Create SharePoint Online List using Power Automate [And Add Different Types of Columns]
- How to Parse JSON Object to Array in Power Automate
- Power Automate Apply to Each Current Item
Conclusion
In this Power Automate tutorial, we have shown how to create a digital purchase order with multilevel approvals using Power Automate cloud flow and the SharePoint Online list in a step-by-step approach.
We also explained the auto-approval mechanism, which occurs if the request is not answered within the specified timestamp. We also send an email to the employee whether the requested Product is Bought or Declined.
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.