cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lupompei
Microsoft
Microsoft

Flow using switch fails if the condition expect is not there

Hello,

 

I have a flow using switch that matches 3 entries. If there is a fourth entry and is not specified the flow failed. Ive tried to create a control (if) to tell the flow do nothing in this case, but this do not solve the problem. 

 

The flow get all entries and check first key with control if. passing the first control goes to switch to test the entries. If matches entry 1, 2 or 3 the flow continue with no problems. Anything different fails on this step

 

For some reason I cant add picture here so I only can describe the flow if needed. 

 

Really appreciate help here

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

Switches have a default case that should pick up any cases that aren't specified.  The one exception to this is if the value being evaluated is null.  That causes an issue.  The fix for that is to add the value being evaluated by the switch inside a Coalesce() function that will supply a default value if the none exists.  In the screenshot below it uses the string "null" if a null value is found.  That will go to the default case if a specific case for "null" isn't added.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

View solution in original post

5 REPLIES 5
zmansuri
Super User
Super User

a15.jpg

Can you use this feature and add Terminate Step once the previous step fails

Pstork1
Dual Super User
Dual Super User

Switches have a default case that should pick up any cases that aren't specified.  The one exception to this is if the value being evaluated is null.  That causes an issue.  The fix for that is to add the value being evaluated by the switch inside a Coalesce() function that will supply a default value if the none exists.  In the screenshot below it uses the string "null" if a null value is found.  That will go to the default case if a specific case for "null" isn't added.

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

Thank you, but the flow is independent. however this will help a lot in other flows. Really appreciate

Question, I m using the information that came from Azure Dev Ops. I need to compose the info ? I will test and them if solves I came back to accept as solution

You don't need to use a compose.  That was just an easy way to get a null entry that I could change in a demo.  You can use Coalesce() around whatever string you are using for input to the switch.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Join me at 365EduCon in Chicago on Sept. 26-30 where I'll be presenting on the Power Platform!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,463)