cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Flow fails on Yes/No column (Big Flow)

So I have a big logic flow with a lot of conditions. However it seems that it always fails on Yes/No (boolean) column check. And even if the condition is true it returns No.

 

Here is the flow:

issue1.png

 

It should ahve went to Yes under the Is Approved by Supervisor.

At first I thought maybe it was set not correctly so I check at the Output of the SharePoint list and it apears to be checked correctly.

 

Here is the row from the output:

issue2.png

 

 

So it should go to yes but it does not.

Here is how the condition is programmed:

 

Basic View:

issue3.png

 

Advanced View:

issue4.png

 

have you guys run into similar problems with Yes/No columns? Any way to make it work? Really appreciate any help, thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

@v-yamao-msftThanks Mabel. I actually went ahead and experimented with several different options and found out that the only reason it was not working is that when I make it in basic view it generates this advanced function:

@equals(triggerBody()?['SupervisorApproved'], 'true')

And the problem with this is that it checks for a string 'true', instead of a boolean value for true. Changing the function to:

@equals(triggerBody()?['SupervisorApproved'], true)

Solves the issue as now it checks for actual boolean true instead of a string 'true'.
I think this should be considered as a Flow bug, since basic view generates a wrong function for Yes/No columns.

View solution in original post

16 REPLIES 16
v-yamao-msft
Community Support
Community Support

Hi MartynasJurkus,

 

I assume that column type of column “SuperviorApproved” should be a Yes/No column type.

 

If yes, please try to convert the parameter of the value to a Boolean using function bool, and in Advanced mode, the Condition should be configured likes @equals(triggerBody()?['Approve'], bool('true')).

 

To test this issue, I create a list with a Yes/No column type. Then create a flow looks like below, with the Condition configured as @equals(triggerBody()?['Approve'], bool('true')). It works as expected.

3.PNG

 

About function bool, please check this documentation for more details:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language

 

Please try it on your side and let me know if it works for you.

 


Best regards,
Mabel Mao

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

@v-yamao-msftThanks Mabel. I actually went ahead and experimented with several different options and found out that the only reason it was not working is that when I make it in basic view it generates this advanced function:

@equals(triggerBody()?['SupervisorApproved'], 'true')

And the problem with this is that it checks for a string 'true', instead of a boolean value for true. Changing the function to:

@equals(triggerBody()?['SupervisorApproved'], true)

Solves the issue as now it checks for actual boolean true instead of a string 'true'.
I think this should be considered as a Flow bug, since basic view generates a wrong function for Yes/No columns.

I have the same problem and I still think that it is a bug, but with a workaround, because when I created these conditions, I choose "Yes" from a dropdown list that clearly recognized the two valid values for the boolean (yes/no) field.

gunjan
Advocate IV
Advocate IV

Give this as a try 


in a compose  bool(SupervisorApproved) and continue to your comparision because (the boolean value should be shown in blue

color) where as text in simple black.solution boolean.png

i have tried with below conditions but no use. it is always showing the false 

@equals(body('Create_item')?['Discarded'], bool('true'))

@equals(body('Create_item')?['Discarded'], bool(true))

@equals(body('Create_item')?['Discarded'], true)

@equals(body('Create_item')?['Discarded'], 'Yes')

 

Try @equals(items('Apply_to_each')?['Discarded'], true)

you need to do the comparison on the left hand side first and then compare if its a true value:

 

this worked for me:

@equals(equals(body('Get_response_details')?['rbe8bb91d66fb4e03bbad0998c12e9e24'], 'false'), true)

 

so in your case:

 

@equals(equals(body('Create_item')?['Discarded'], 'true'),true)

 

inner equals is checking your create item discarded if its equal to true to get a bool value, then compare that to the outer equals if its true or not.

Anonymous
Not applicable

Microsoft removed the "Edit in Advanced Mode". How would you do this with Expressions in the basic editor?   The basic editor requires two fields to be populated.  

 

no advanced mode.png

to get around this. In the left side of the condition click on it. It would popup the dynamic content tab. click on expression and type "equals". now in the example i gave you need to split it into two:

image.png

@equals(equals(body('Create_item')?['Discarded'], 'true'),true)

=

equals(body('Create_item')?['Discarded'], 'true')

 

so when you type equals with the open and close bracket click inside it and select dynamic content and then select the object, mine is create item, then go back to expression and then type: , 'true'

 

 

so in the expression you would see 

 

equals(body('Create_Item'),true)
 
image.png
 
click the ok button, now you would have the first half (inner half of the condition), for the right side click on the box
and select expression again, this time type true and click ok. This would be the outside bool condition.
image.png
so to recap, left side is inner condition, using expression equals we get a bool result and then we compare that result to the right side if its true(outer expression).
 
 
 
 
Anonymous
Not applicable

Conceptually, this is making sense now. Thank you for that. Where I'm stuck is that in the left side, I can't select the SharePoint column 'Notify'. Once I do the open bracket, I only have 2 choices for the SharePoint list and neither is a column. 

 

sharepoint choices.png

@Anonymous  you are typing correctly but need to click on Expression first before typing "equals" becuase "equals" is an expression and not a dynamic varible 😉

 

expression tab you click first that is the outside, inside the expression you put in the varibles so you click on the "dynamic content" 

 

a simple view would be:

 

expression ( dynamic varible , dynamic varible or expression)

lavint
Helper I
Helper I

Found my solution. Thanks

Can you try bool(body('Create_item')?['Discarded']), true [boolean value], as the output from body('Create_item')?['Discarded'] might be resulting into whole answer coming to be False.

Had same issue with a flow I was making, as I was entering [Is Equal to - Yes] and it was failing whether the list item had been set to Yes or No - but came across your post and adjusted my test to true and now works fine.

bnerd
Advocate II
Advocate II

I had a smilar situation in my flow where I was checking the value on a Yes/No list column. Tried with 'Yes', and 'true' values but could not get it to work as intended. 

 

I solved it by simply clicking on Expression and typing true. This way the flow compares it to the actual value, rather than string 'true'.

 

Annotation 2019-07-31 114034.png

Had the same issue with boolean columns in the tables and no found solution worked. What did the trick was simply switching from boolean values to strings with similar meanings (e.g., yes/no) and fields could now be simply matched as strings.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (4,121)