cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Steveo1
Level: Powered On

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

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!

View solution in original post

3 REPLIES 3
Highlighted
Super User
Super User

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!

View solution in original post

Steveo1
Level: Powered On

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.

 

Community Support Team
Community Support Team

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

Hi @Steveo1 ,

 

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,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 313 members 5,625 guests
Please welcome our newest community members: