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:
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:
So it should go to yes but it does not.
Here is how the condition is programmed:
Basic View:
Advanced View:
have you guys run into similar problems with Yes/No columns? Any way to make it work? Really appreciate any help, thanks!
Solved! Go to Solution.
@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.
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.
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
@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.
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.
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.
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.
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:
@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
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.
@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)
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.
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'.
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.
User | Count |
---|---|
5 | |
5 | |
4 | |
2 | |
2 |