“The request should go for approval to various number of approvers depending on its details, what’s the easiest way to do it in Power Automate?”
When you build an approval flow in Power Automate, you don’t want an extra branch for each approval path. Such flow would be big, complicated, and you’d get easily lost in it. You should avoid repeating actions whenever it’s possible using configuration lists. And it doesn’t apply only to flows with a single approval step. You can use a configuration list for a whole approval path too!
That’s what this post is about: how to use configuration list for a whole approval path with various number of approvers?
Use configuration list in SharePoint
To build a configuration list for a whole approval path it’ll have to be a bit bigger. You’ll need at least 3 columns – the approval path, the approver, and his order. These 3 columns are a must, but you can add a few more extra if you’d like, e.g. the role of each approver.
The configuration above contains 3 approval paths with various number of approvers. The Path1 goes to Manager, CFO and CEO in this order. Path2 goes to HR assistant and HR Lead. And Path3 goes only to a single approver, the Team leader.
Build the approval flow
Once you have the configuration list, you can start with the flow. The first step is to decide which path should the approval go, let’s say it’ll depend on the request value.
Initialise a string variable, e.g. var_path, and decide which path should the request go, e.g. with ‘Condition’ actions.
Now, when you’ve got the path in the variable, you can do a lookup to the configuration list. Make sure that you also sort the outcome using the order column in ascending order. The result will be all the items from the configuration list for the given path.
And since it’s an array with multiple items, you can process them one by one in an ‘Apply to each’ loop. Take each of the configuration items, and assign an approval task to the currently processed approver.
That’s why it’s important to sort the ‘Get items’ result, to assign the tasks in the correct order.
End the loop on rejection
But because you’re using a loop, it would create approval task for each of the approvers even if it’s rejected. To avoid that you’ll need one more variable and a ‘Condition’.
Initialise another variable, e.g. var_rejected and set it to ‘false’. This variable will tell the flow to stop creating tasks if somebody rejects.
Go back to the ‘Apply to each’ and add a ‘Condition’ to check if the variable is equal to ‘false’. If it’s ‘false’, create the approval task. If it’s not ‘false’, do nothing.
All that’s left is to set the variable to ‘true’ if somebody rejects their approval task: Outcome contains ‘Reject’.
If the variable is still ‘false’ at the end of the loop, it means that everyone approved.
The full flow diagram
As you can see in this article, you can build a simple approval flow in Power Automate even if you’ve got multiple approval paths with various number of approvers. Instead of building a fixed flow for each approval you can store the moving parts in a configuration list and use them dynamically when needed.
The flow above is a very simple approval flow to explain a concept and there’s a lot of space for improvements. You should store and display the approval history, you might need to avoid infinite trigger loop, add task reminders, send information emails, etc.