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 / No option to include d...
Power Automate
Unanswered

No option to include dynamic content in switch case

(0) ShareShare
ReportReport
Posted on by 338

No option to include dynamic content in switch case so I used text - tried "yes" and "true". Getting error:

 

The execution of template action 'Switch' failed: The result of the evaluation of 'scope' action expression '@triggerBody()?['Check_x0020_here_x0020_to_x0020_']' is not valid. It is of type 'Boolean' but is expected to be a value of type 'String, Integer'.

 

Untitled.png

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    Try wrapping the field in a String() function using the expression tab.  That should output the boolean as text.  But if its Boolean, why use a Switch.  Booleans only have two values. In that case you would be as well off using a Condition.

  • webbrewer Profile Picture
    338 on at

    Initially, I used a condition but if the response was "no" the flow failed. I tried a switch control to see if that resolved the issue. There's no action required if the response is "no", so I just need the flow to continue to the next step, but it doesn't. 

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    There's a common problem that comes up when working with boolean fields in a condition.  When testing against true/false the test is case sensitive.  The way to fix that is to use the true/false enumeration rather than just typing in true or false.  To get the enumeration value insert the value using the Expression tab in the dynamic content dialog.  As you type true or false it will show the enumeration value in the intellisense.  Picking that will always test the value appropriately.  Here's a screenshot.

    image.png

  • webbrewer Profile Picture
    338 on at

    Yep, that's the way I set up the condition. It fails to move to the next step if the response is false, I assume because no action is specified in the "false" option. Is there an action to force it to move on regardless of response in the condition? Or do I have to add some random action there?

     

    Untitled.png

  • Pstork1 Profile Picture
    68,697 Most Valuable Professional on at

    It should move on to the next action even if there isn't anything there.  If you just want to put something there to test it you can just use a Compose Action with a static value.   But when you say next action do you have more than what is shown in your screenshot?  Because your screenshot doesn't show any next action.  Just the actions that are taken on the yes side.

  • webbrewer Profile Picture
    338 on at

    Ok, now it moves on to the switch action, but fails there because it finds a "null" value instead of a string? There are 3 dynamic choices offered - get item, update item and when an item is created - but no hint as to which one to use.  The interface is really frustrating....

     

    Untitled.png I've now tried all 3 flavors and all throw an error. Hard to imagine how Msft could make this any less intuitive.

  • Community Power Platform Member Profile Picture
    on at

    @webbrewer 

     

    If the Condition action block is working now, why are you still using the Switch?

     

    Could you maybe give a little background/context for your Flow to give an understanding of what it is you want it to do?

     

    thanks,

    Kyle

  • webbrewer Profile Picture
    338 on at

    Sure.

    When item is created

    Condition checks value in a boolean field and if true, updates another field with manager email 

    Switch checks value in a choice field and sends a different email depending on the choice value

  • Community Power Platform Member Profile Picture
    on at

    @webbrewer,

     

    thank you,

     

    You're sure that

     

    1. You are passing in something to be checked against the cases, and

    2. Each of your cases has something to check against?

     

    Those are my top guesses as to why the error message would say that the type is "Null".

     

    Then, is there the possibility that nothing was chosen in the choice field?

     

    thanks,

    Kyle

  • webbrewer Profile Picture
    338 on at

    Yes. 

    Untitled.png

    Item in SP:

    Untitled.pngA

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