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 III
Dual Super User III

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.

View solution in original post

5 REPLIES 5
zmansuri
Community Champion
Community Champion

a15.jpg

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

Pstork1
Dual Super User III
Dual Super User III

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.

View solution in original post

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

Pstork1
Dual Super User III
Dual Super User III

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.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,204)