cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Flow with more than 5 conditions

I am trying to build a flow that kicks off an email based on a sharepoint site. My problem is the number of nested conditions I can use is limited to 5. 

 

My flow is pretty simple - I have a choice field on my Sharepoint list. The choice made should direct where the email goes to. 

 

So it looks like:

Condiiton 1

Choice A -> 

Yes -> choicea@x.com

No ->

Condition 2

Choice B ->

Yes -> choiceb@x.com

No ->

Condition 3

Choice C ->

.....

 

But I can't get all my choices in this nested condition because I have more than 5 to choose from. 


There has to be a better way to do this but I am too new to the product to find it. Can anyone provide some direction?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi jf82,

 

Have you tried with Switch Case feature? 

 

Flow supports nested conditionals, which make it possible to have very advanced branching logic. Switch case makes it very easy to have parallel branches of conditional logic based on a single value.

search-by-service-add-switch.png

 

You can find switch by selecting the More ... option after selecting New Step and then choosing Add a Switch Case. Inside a Switch Case you will select a value from the trigger or a previous step to switch on. For example, if you use this template for a SharePoint approval flow, the switch is on the option the approver selects in the approval email. 

search-by-service-switch.png

 

Please go ahead and try to use switch case instead. Let me know if this works for you.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Advocate I
Advocate I

Hopefully someone will respond to this one, as I am running into the same issue. Although, I would love to limit my initial list results or use 'AND' 'OR' functionality to prevent the need for having so many conditions.

Community Support
Community Support

Hi jf82,

 

Have you tried with Switch Case feature? 

 

Flow supports nested conditionals, which make it possible to have very advanced branching logic. Switch case makes it very easy to have parallel branches of conditional logic based on a single value.

search-by-service-add-switch.png

 

You can find switch by selecting the More ... option after selecting New Step and then choosing Add a Switch Case. Inside a Switch Case you will select a value from the trigger or a previous step to switch on. For example, if you use this template for a SharePoint approval flow, the switch is on the option the approver selects in the approval email. 

search-by-service-switch.png

 

Please go ahead and try to use switch case instead. Let me know if this works for you.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

This is perfect and allowed me to do what I was hoping for. I wasn't aware of this function but it let me do exactly what I needed, 

 

Thank you. 

Switch case usually requests to know what something is "equal" to. Has anyone come across a need to use a switch case but want the choice to be something that just "contains" a certain string/value?

 

ie: if 'jobTitle' contains "manager" do A.  If 'jobTitle" contains "chief" do B. If 'jobTitle' contains "Director" do C.

Hi, I'm running into the same issue as the OP and unfortunately the problem does not seem to be solved with the switch feature. I have created a flow triggered by an MS Form which has 12 possible answers to the first question. Since I found out like the OP that creating 12 parallel branches of conditions was impossible (it kept freezing at the 5th), I turned to the forums and found your solution and I really thought it would work as it was really easy to create 12 different cases in the switch feature. However once I started adding a series of actions (including some nesting conditions) to each of them and reached the 6th case, the whole flow is now freezing every time I try to add anything else to the next case. Is there a cap on the number of cases? In that case is there any way of bypassing it or do I need to create different flows with the same trigger? Would that create potential issues? Any help on the matter would be greatly appreciated. Cecile

I am also running into the same limitation. I humbly offer the solution found in the post linked below to create a workaround, although this secret hard-limit is really a pain. Hopefully someone from MS sees this and takes the initiative to fix a problem for more advanced Flow implementation:

https://powerusers.microsoft.com/t5/Building-Flows/Multiple-Flow-Conditions/td-p/117671

 

Solution: Created condition with expression values on each side of the operator. My example:

 

Expression - 

and(equals(triggerBody()?['TYPE_x0020_OF_x0020_INSTALL']?['Value'], 'SHOP'), equals(triggerBody()?['INSTALL_x0020_STATUS']?['Value'], 'INSTALLED'))

 

Operator - 

Equals

 

Expression - 

true

 

Regards,

Alex

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (6,353)