Wide monitor for MS Flow

Recently, I was told by one of my followers that the switch step in Microsoft flow can only handle 27 options. So I thought today I will put this to the test.

I started with a large switch that tests for the current day of the month. This should return 1-31.

I’m using the following expression for this:

dayOfMonth(utcNow())

Flow with a switch that has a case for day 1 to day 6

To make this all fit on your screen you might need a wide monitor!

wide screen monitor

When you get to your 27s case in your switch statement the + icon simply doesn’t work. No error messages or warnings. Just plain nothing happens.

case 26 and case 27

What should you do when you want to handle more than 27 cases in a switch?

The answer to this question is simple!

Added an additional switch in the default branch of the first case

Create a second switch in the  Default branch of the first switch. Yes, you could even place the two switches underneath each other as two sequential steps but that would make it harder to understand the logic of the flow when you need to debug the flow using the run history.

But then as a built my flow and I tried to save the flow I got the following error message

The template action 'Switch' at line '1' and column '958' is not valid: the number of cases used '27' exceeds the maximum number allowed '25'.

The template action ‘Switch’ at line ‘1’ and column ‘958’ is not valid: the number of cases used ’27’ exceeds the maximum number allowed ’25’.

Well that is very clear. The limit is 25 items, but you are only told as you save the flow. Reducing the number of cases to 25 in my flow solved the problem

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

2 thoughts on “Microsoft Flow – Large switches 25+ options”
    1. When switch works on a number then that works. But if you have a switch on a text then that is unlikely to work. The additional switches in the default branch will be easier to manage.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading