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 Automate - Building Flows
Answered

Boolean variable inside Condition is seen as 'string' rather than 'boolean'.

(0) ShareShare
ReportReport
Posted on by

I'm getting a weird error from Flow inside a condition.  I'd appreciate any insight people can give me.

 

The left side of my condition, which is set as a boolean variable, is being evaluated by Flow as a string value.  Before the variable, I was checking for empty() on the left side of the condition with the same result.  I've used similar syntax successfully in other Flows.

empty(variables('ContactId'))

Flow Screenshot.pngContactExists Screenshot.png

I have the same question (0)
  • Verified answer
    Brad_Groux Profile Picture
    4,556 on at
    Re: Boolean variable inside Condition is seen as 'string' rather than 'boolean'.

    Can you show a screenshot or paste in the code behind the IfContactIdExists condition? If the value is coming in as string, you can easily convert it to boolen by wrapping it in bool(), example

    bool(true)

    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!

  • Community Power Platform Member Profile Picture
    on at
    Re: Boolean variable inside Condition is seen as 'string' rather than 'boolean'.

    @Brad_Groux wrote:

    Can you show a screenshot or paste in the code behind the IfContactIdExists condition? If the value is coming in as string, you can easily convert it to boolen by wrapping it in bool(), example

    bool(true)

    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!


     

    It is simply my boolean variable:

    variables('ContactExists') 

    Before that, I was checking empty() on the id, which also returns a boolean. 

     

    I just discovered that the "if yes" path of my condition works fine.  I'll delete the "if no" actions and redo it.  I can try the bool() option if all else fails.  Thanks.

     

  • v-bacao-msft Profile Picture
    on at
    Re: Boolean variable inside Condition is seen as 'string' rather than 'boolean'.

    Hi @Anonymous ,

     

    Could you provide screenshots of Create a new record action configuration and the details of if() function configuration?

    I did a test on my side. If I configured a Boolean variable in if() function, there would be no similar error.

     

    Image reference:

    20.PNG21.PNG

     

    Please take a try.

    Best Regards,

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 560 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 347 Moderator

#3
Expiscornovus Profile Picture

Expiscornovus 262 Most Valuable Professional

Last 30 days Overall leaderboard