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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Boolean variable insid...
Power Automate
Answered

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

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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

Categories:
  • Verified answer
    Brad_Groux Profile Picture
    4,556 on at

    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
    Microsoft Employee on at

    @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
    Microsoft Employee on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 271

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard