Forum Discussion
albertstain
Sep 15, 2020Brass Contributor
Using conditions in Flows - different approvers depending on DisplayName result
I have the following flow which gets information for a certain file and requests approval from a set list of approvers as below: However, I have about 20 different folders where I need to do this...
Sep 15, 2020
You could do a switch instead of condition and have the folder value as the switch and then 20 different items. Or what I would do is have a separate list that has the folder mappings. This way it can be controlled and updated in the list instead of having to add or remove from the workflow and save it each time etc.
So you could have two columns. The default title and then add person column and put approved. Have the 20 in there. Then just use “get items” and use a odata filter there. It’s something like “title eq foldername” where foldername is the dynamic folder name from your step. Then it will just return the first item it finds and you can then use the approved from that get items. I think you can wrap it in a first() or some similar expression to return one record so you don’t have to deal with looping on the following steps.
Anyway hope this makes sense. Either method can work. But the list lookup method is a little more dynamic and you can have others easily make updates that way if needed.
So you could have two columns. The default title and then add person column and put approved. Have the 20 in there. Then just use “get items” and use a odata filter there. It’s something like “title eq foldername” where foldername is the dynamic folder name from your step. Then it will just return the first item it finds and you can then use the approved from that get items. I think you can wrap it in a first() or some similar expression to return one record so you don’t have to deal with looping on the following steps.
Anyway hope this makes sense. Either method can work. But the list lookup method is a little more dynamic and you can have others easily make updates that way if needed.
- albertstainSep 15, 2020Brass Contributor
ChrisWebbTech I've tried using Parallel Branch and seems to work but again I'm going to need to create 20 branches.
I've only just started using Flows and am still learning so not sure how to use Switches yet like you've outlined.
Are you saying I can create a List with 2 Column values (Folder Name and Names of Approvers) on my Site and use it as a reference for my Flow?
- Sep 15, 2020Yes. I have a pretty complex flow where different categories assign different tasks and it’s all based on a value in a separate list that we use to control the categories and assigned individuals. The flow reads the list on saving a form and sends out tasks etc. dynamically based on the SharePoint list. This way you never have to update the flow to update the logic / assignments of approvers.