2

What is the proper way to use booleans in Logic Apps conditions? If the bool is set to true, the workflow should continue in the YES branch but I allways end up with this error-message :

ActionBranchingConditionNotSatisfied. The execution of template action 'HTTP' skipped: the branching condition for this action is not satisfied.

{
    "reservations": {
    "sendBooking": true
}}

enter image description here

2 Answers 2

6

If you switch to "Advanced mode" in the condition card, you should see the expression looks like @equals(triggerBody()?['sendBooking'], 'true')

Update it to @equals(triggerBody()?['sendBooking'], true) and your logic should work.

This is because, by default, we treat true as a string, but in this case it needs to be a Boolean.

Workaround above should unblock you, I will discuss with the team to see how can be better handle this scenario.

5
  • That does not work either, "Condition is too complex or invalid. Unable to switch to basic mode."@equals(triggerBody()?['reservations']?['sendBooking'], true) Mar 8, 2017 at 7:29
  • 1
    The error message shows up to indicate condition card unable to switch back to basic view, but you should be able to save and run the Logic Apps regardless of this particular message.
    – Derek Li
    Mar 8, 2017 at 21:04
  • @DerekLi When will this be fixed and is there a better way to go about it? Should we use a boolean variable? Aug 17, 2017 at 17:13
  • Doing this fix shows "fx true" in the Basic view, because it's recognized as an expression, but I can't find true in the expressions list. Aug 17, 2017 at 17:50
  • you can either use @bool('true'), or true, we will add true and false to the list soon.
    – Derek Li
    Aug 17, 2017 at 18:44
0

The workaround was to remove the '' in code view, then I was able to save the logic app. But the error still exists in the designer.

enter image description here

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.