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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Converting Yes/No text...
Power Automate
Unanswered

Converting Yes/No text to Boolean

(1) ShareShare
ReportReport
Posted on by 112

Hi,

 

I'm building a flow where I need to convert a Yes/No text field to a CDS Yes/No field

 

I'm using:

if(triggerBody()?['car'],"Yes",true,false)

 

i.e. if the input text value is Yes, I want to set the CRM field to yes (I assume this is a boolean true/false, maybe it's the wrong assumption), any other text input (i.e. No or blank), I want to set the CRM field to NO

 

but I'm getting an error message, can anyone point out what I'm doing wrong?

 

TIA 🤔

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at
    Re: Converting Yes/No text to Boolean

    Hi @AngeloA 

     

    True and false should just work fine for a field of type two options. Can you share a screenshot of the flow and the error that you are seeing? 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • AngeloA Profile Picture
    112 on at
    Re: Converting Yes/No text to Boolean

    thanks @yashag2255 for having a look at this, the flow is rather simple, receive an email and create a record

     

    image.png

     

    Then I get to my yes/no field and select Enter Custom Value

     

    image.png

    I enter my expression: if(triggerBody()?['car'],"Yes",true,false)

    image.png

     

    And I get the erro message:

     

    image.png

     

    TIA!

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at
    Re: Converting Yes/No text to Boolean

    Hi @AngeloA 

     

    can you replace the expression as: if(equals(triggerBody()?['car'],'Yes'),true,false)

     

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • AngeloA Profile Picture
    112 on at
    Re: Converting Yes/No text to Boolean
    Nice one @yashag2255!
  • Ben94 Profile Picture
    2 on at
    Re: Converting Yes/No text to Boolean

    Better yet you can just use the bool() instead of doing if((true),true,false)
    i.e.
    bool(equals(triggerBody()?['car'],'Yes'))

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard