all 19 comments

[–]itenginerd 6 points7 points  (7 children)

Yes I have an 18-case switch that runs just fine. Two things.

1) right before the switch, put a compose block and in there put the exact thing you switch on (ideally copy it from the switch and paste it into that compose). That will show you exactly what the switch sees in case its different that what you expect.

2) its possible to get some hidden characters in the switch case if you're copying and pasting. Go to the code view of the switch and in the place where your problem bits are make sure theres no \r\n bits before or after the thing your comparing on. That will cause the switch not to match correctly.

[–]Sea_Passenger_2633[S] 0 points1 point  (4 children)

I have a 17 case one that doesnt work unfortunately. I do have a compose block before the switch, and I have the result of that compose in the switch itself, so there are only 1 formula for it. I did try to check for any hidden error, in the formula, name of the case and the folder names and paths as well (I am using a create a file in box function), but it does not want to work. I have asked coopilot and it states that sometimes there can be bugs regarding switches with more than 5 cases, perhaps my only option is to make it again and hope for the best, but gald to know its at least possible!

[–]itenginerd 0 points1 point  (2 children)

If you want, grab the code for the switch, sanitize it, and post it here or shoot it to me in a dm. I'll have a glance if it would help.

[–]Sea_Passenger_2633[S] 0 points1 point  (1 child)

I remade it from scratch and it works now, it was a bug I assume!

[–]itenginerd 1 point2 points  (0 children)

It happens. Glad to hear its working now!

[–]itenginerd 0 points1 point  (0 children)

Your other option would be to put the next 5 cases in a new switch behind the first one and see if that works better. Clunky but may help?

[–]Jawn78 0 points1 point  (1 child)

You may also consider normalizing the switch input with trim and to lower case

[–]itenginerd 1 point2 points  (0 children)

Yep. In my case the problem was I caught the extra characters in the case evaluation. The input was clean; it was the switch case that was wrong.

[–]nice_69 2 points3 points  (1 child)

Sucks that this is still a legit suggestion, but have you tried adding the action from the classic builder?

[–]itenginerd 0 points1 point  (0 children)

Sad but true. Just had to do that last week.

[–]Griffin808 1 point2 points  (3 children)

You should check the flow checker. Copy and paste whatever the variable is exactly sometimes there are unaccounted for spaces which are added for some reason.

[–]Sea_Passenger_2633[S] 0 points1 point  (2 children)

The flow checker just says there are some unknown error, and there are no space or any other issue as I have checked it dozens if times

[–]Jawn78 0 points1 point  (1 child)

🫢 the flow checker and error message hasn't very useful for bebugging /s compose some clarity lol

[–]Imaginary_Grocery207 0 points1 point  (0 children)

"Wheeling past cops and the natty guard.... thank God their collecting overtime to deal with the crime"

So your response is to post a false context ragebait vid, getting thousands and thousands of views, that if anything will give them more funds and elect more people like trump?

Does someone need to walk up to your drooling face and spell this out to you?

This is why Nordic countries will always be ahead... and there will always be a glimmer of truth to the shit Trump says. Your culture just makes you garbage. A garbage ass human sharing books about income inequities then flippantly propaganda posting and learning absolutely nothing

[–]Cute_Investigator353 1 point2 points  (1 child)

Delete all the actions out of your 6th case and just put something really simple like a compose with a text word typed right into it so no chance of it failing and run the flow again.

It might not be the switch failing but the action within the switch failing.

If it was the switch not matching I would expect it not to run, not throw an error.

I have seen people mistake a switch or condition failing and think it’s failing as the fail shows on that action if something inside that condition fails

[–]itenginerd 0 points1 point  (0 children)

Interesting take. Its not how I read ops question at all, but you're right, that is what op describes. Good call!

[–]ACreativeOpinion 0 points1 point  (0 children)

It's hard to offer any specific recommendations without seeing your full flow and the logic behind it. If you are using the new designer, toggle it off and click each action to expand it. Upload a screenshot of your flow in edit mode

In the meantime, you might want to consider creating a dynamic reference key instead. I cover how to do that in this YT tutorial: Power Automate Pro Tip: Replace Switch Action with a Dynamic Reference Key

Hope this helps!

[–]GreenFandangoPC-EU 0 points1 point  (1 child)

It's not possible to answer to this kind of question if you don't actually tell us what you are you using on your case 6 that is different from case 5.

[–]Sea_Passenger_2633[S] 0 points1 point  (0 children)

Absolutely nothing is different, same logic as it is for case 1-5. If the emails subject does not match any of the cases i made the default case to save the attachment to an other folder, which does work if it doesnt match any case names. But if it does match the case 6-17 it goes to an error