“I have an approval process with different approvers based on a department, how can I build it in Power Automate without repeating the same actions?”
Every time you start adding repeating actions in your flow, you should pause for a moment. Is it really necessary to have another action, or does it contain only minor changes from the other one? Is it another approval task only to use different approver? Or is it a whole branch in a flow only to send slightly different email? Your flow should never look like the one below.
Such flow will have too many actions, it’ll be slow to open, and imagine if you want to do any changes in it. You’d have to update all the duplicate actions with every change you do.
That’s why you should use configuration lists.
Why use a configuration list
A configuration list will help you avoid hard coding inputs directly in your flow. If you have for example an approval process, you don’t want to assign the approval task directly to a specific user in the flow.
Such configuration would mean that if the approver changes, somebody would have to update it in the flow. And if there’s another approval task for a different approver, you’d need another action leading to the first screenshot.
You should always use dynamic contents in this situation, and if it’s not available from previous actions, you’ll need a configuration list.
What is a configuration list
Configuration list is a data source where you can lookup a specific information. In combination with Power Automate it’s often a SharePoint list (or Lists list). Such list contains at least 2 columns – a value used for the lookup, and the value to return. It can be e.g. a list of approvers per user, or a list of approvers per department.
How to use a configuration list
To get a value from a configuration list you must add a lookup to the list into your flow. Use the ‘Get items’ action with a Filter Query on the configuration list. Continuing with the list above, you want to get the Approver for the specific department.
The returned item will be the corresponding configuration entry, with the configuration available as a dynamic content. Use it to assign the task. The final flow will then be much simpler.
Note: if you don’t like the automatically added ‘Apply to each’, you can remove it, but it’s not a must.
Summary
You should always have a good reason for repeating actions in Power Automate flows. If it’s only to change some value in an action, you should use a configuration list instead. Keep the action only once in the flow, and change its input based on the configuration.
There’s no limit on what your configuration list will look like. You need one column used for the lookup, and then it’s up to you how many more columns with information it’ll have, the usage will be the same. You can even use multiple columns for the lookup, all you have to do is use multiple filters in the Filter Query.
You could even define whole approval paths in the configuration list if you extend it.
“I have an approval process with different approves based on a department and Location, how can I build it in Power Automate without repeating the same actions?”
Hello Berihun,
you can follow the same process – create a configuration list with 3 columns – department, location, and approver, and then lookup to the list using 2 filters in the Filter Query instead of one: https://tomriha.com/how-to-combine-multiple-filters-in-get-items-filter-query-power-automate/
What a great idea! This is the perfect solution to a long winded Switch statement that has minimal changes between the cases. Thanks!!
How can I use Look up to filter?
Hello Berihun,
you can filter as described here: https://tomriha.com/power-automate-filter-on-sharepoint-lookup-column/
Approval Flow with multiple approves – I want to save all Approve Names in one SharePoint Column? how to do this?
Great article ! Thank you.
However, I have another question, what if the end users can select several department for review? For example, HR and Finance and Sales, all three at the same time?
Hello Jack,
I don’t know right now how I’d approach that. If it’s different departments then you probably want a different approval task for each of them but at the same time you also want to cancel the other approvals, e.g. HR and Finance in case Sales rejects. Which I think will be quite complicated to do as parallel branches are not connected to each other.
I’ve done what you have outlined above as I want the approval to go to a head of department based on the list. My flow works however, when it gets to the approval stage, the outcome of my condition always goes to false, even though I have approved the request. I have used the same flow without the list and used a hard coded email for the approver and this works, it is only when I use the get list and use the department email address that I have the issue with the approval outcome always showing as false. Do you have any ideas?
Hello Claire,
I’d use the basic debugging approach – add a ‘Compose’ action before the ‘Condition’, store both the dynamic contents from the ‘Condition’ in this ‘Compose’, and then you’ll see in the flow run history what values enter the ‘Condition’ and why it’s always false. Once you’ll know the values you can adjust the ‘Condition’ accordingly, e.g. use contains instead of equals, or change the value, e.g. Approve instead of Approved.
Maybe your approach can help me:
I use PowerAutomate to generate a Onenote Notebook based on a Forms-Entry… In that Notebook a section will be created with all the informations i need from the Forms… We’ve 12 departments, so 12 “possible” titles… As for now, i’m using the “if it’s not” on the title of each of the departments to go trough the flow… But now i’m at the 8th condition and of course at the limit…
Any ideas on how i can solve that? Thanks a lot