cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

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 II
Super User II

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 II
Super User II

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

Highlighted
Advocate I
Advocate I

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.

 

Highlighted
Community Support
Community Support

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
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (7,422)