web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Switch - Action not ma...
Power Automate
Unanswered

Switch - Action not matching Case results

(0) ShareShare
ReportReport
Posted on by

Hello,

I have a flow with a switch control triggered by a form, where the switch depends on the answer to one of the questions (Single Choice + "Other" with an empty space, hence the "Default" case).

 

I have tested the form with an answer that I know matches Case 4, and when the Flow is run it indeed identifies it as matching; however, instead of following the action intended in that Case, it triggers the Default Case action.

 

Any ideas?

case-action.PNG

Categories:
I have the same question (0)
  • nageswar_k Profile Picture
    14 on at

    Check for the Case Sensitivity and any unwanted spaces for the Case 4..  

  • Community Power Platform Member Profile Picture
    on at

    I have a Compose action to replace spacing before the switch action:

     

    replace(variables('aplicabilidade'), ' ', '')

     

    ("aplicabilidade" being the value extracted from the Form)
    and then manually applied the same replacement to the values before adding them to the switch control.
     
    Since (for other than spacing) they are literally copy-paste from the Forms to the Switch, Case Sensitivity should not be an issue...
  • nageswar_k Profile Picture
    14 on at

    Instead of using     replace(variables('aplicabilidade'), ' ', '') use trim(variables('aplicabilidade')), this Trims leading and trailing whitespace from a string. 

     

    Go to History, --> Select the flow where you have selected the 4th Case.  --> then go to the Switch statement and check what is the value received from the form.

     

  • Community Power Platform Member Profile Picture
    on at

    case-action2.PNG

    This is a photo from the history log of my previous run.

    Even after the swap from replace to trim the same event happens (matches Case 4 but executes Action from Case 5)

  • Community Power Platform Member Profile Picture
    on at

    Removing the Compose Action and manually setting the spacing/formatting in the Cases does not seem to fix it either...

  • Sahar-Kalif Profile Picture
    20 on at

    Hii,

    I had the same problem and found the reason for that

    In my case there was invisible character - How can I tell? I took the text and put in on notepad, I played with the keyboard arrows and saw that in the end of the string when I press left - I wouldn't move to the double quate, but the next press it go to the end.

    Here is example of my result, just copy to notepad and you will understand: "Boolean​"

    Once I found it, I copy the invisible char and used replace function to removed it

     

    Hope that's helps,

  • Community Power Platform Member Profile Picture
    on at

    Hello,

     

    I ended up redoing the entire Switch action and that fixed it.

    While I can no longer test the procedure described in your post, it does seem to be a valid explanation for the error I was encountering.

    Thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard