cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AftabHussainUK
Level: Powered On

Switch max cases

Hi,

 

The following blog implies you can create as many cases in a Switch as you want, Below the Switch On, you can add as many cases you want. https://flow.microsoft.com/en-us/blog/search-by-service/

 

@v-yamao-msft also mentioned that he/she couldn't find any limitations mentioned. However I've tried to add cases and it stops at 27 plus the Default case. Is this a bug or an undocumented limitation? https://powerusers.microsoft.com/t5/General-Flow-Discussion/Switch-case-limitations/m-p/137232

 

What can be done to work around this if it is a limitation?

 

Aftab

5 REPLIES 5
Dorul
Level 8

Re: Switch max cases

Hi @AftabHussainUK

99% chances to exist a workaround, almost everytime there is one 🙂 even if that means to split your flow in 2-3 flows.

By any chance, you want a switch case in flow because you have a sharepoint list with a Choice column, to choose from? And you need the flow for approvals, or?





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





AftabHussainUK
Level: Powered On

Re: Switch max cases

Hi @Dorul


That's pretty much it, not approvals though, keying off of a column, with then add's the list item to an Excel table stored in SharePoint. Currently there are at least 50 values in that column, so 50 cases is what I need immediately, but this number could grow to considerable more than that, to over 100.

 

I'm not sure how multiple flows would work in this case. The flow is like this.

 

Trigger: SharePoint item created or updated

Item Column: RefNo <- about 50 different values currently

Case 1 { Do something for RefNo 1 }
Case 2 { Do something for RefNo 2 }

How would I trigger a different flow, based on the same column?

Dorul
Level 8

Re: Switch max cases

{ Do something for RefNo 1 } doesnt help much 🙂 

I have an example that I was testing some time ago, and might help you if you modify it to your needs. You dont even need to create all the 50-100 cases but you might need to create lots of conditions.

 

Capture.JPG

 

 

 

 

 

 

 

 

I had 3 departments, EAST, WEST and SOUTH, choices by radio buttons in sharepoint list. According to what they choose, my flow was sending an email to someone.

if(equals(variables('DEPART'),'EAST'),'xxx@mail.com',if(equals(variables('DEPART'),'WEST'),'xyxy@mail.com','zzzz@mail.com'))

So for EAST flow was sending mail to xxx@mail.com, for WEST flow was sending to xyxy@mail.com and any other choice - sending a mail to zzzz@mail.com.

If you need it for some other actions and not mails, you can compose a condition, this might help you:

https://powerusers.microsoft.com/t5/General-Flow-Discussion/Multiple-Flow-Conditions/m-p/31510#M6985

Lets say you combine a condition for 5-10 choices, continue in the No branch with another condition (obviously, if no condition is fulfilled, the flow will go on No branch). Plus, I think its faster than creating 50 cases with different actions after each.





Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!





AftabHussainUK
Level: Powered On

Re: Switch max cases

Not sending email so the first action won't work and the second action won't work because I am only making a decision based on a single column, so I don't see a way to combine 5-10 options together.

 

The action is Add a Row (Excel Online, Business).

 

I have just tried to use a dynamic filename / folder path, but that is not supported currently, see https://powerusers.microsoft.com/t5/Building-Flows/Dynamically-Updating-Excel-Rows/m-p/121505/highli...

Super User
Super User

Re: Switch max cases

Dang! I have ~35 cases to switch on... just completed 26 and got this error...

image.png

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,088)