Skip to main content
All CollectionsCommon Errors
Error running calculation - Invalid condition result (Boolean)

Error running calculation - Invalid condition result (Boolean)

Error running calculation - Invalid condition result. Must be Boolean

Praise Magidi avatar
Written by Praise Magidi
Updated over a week ago

Step

Condition Control Step.

Message

Error running calculation - Invalid condition result. Must be Boolean.

Cause

The JavaScript code written inside the Condition step that determines whether the Condition Subflow should be executed does not resolve to a `boolean` type.

Resolution

Assess the code in the Condition step to determine where it can be changed to return a `boolean` (true / false). With its truthy / falsey values, writing `boolean` expressions in JavaScript can sometimes be confusing. Here are some general tips on handling `boolean` expressions in JavaScript:

  • Use `===` or `!==` when doing comparisons

  • Coerce explicitly using the `!!` syntax to force values to be a `boolean`

  • Be careful with falsy values like `0`, `""`, `null`, `undefined`, and `NaN`

  • Avoid Boolean object wrappers like `new Boolean(false)` (which is truthy).

Error Detail

json
{
"message": "Error running calculation",
"statusCode": 400,
"error": {},
"errorMessage": "Invalid condition result. Must be Boolean",
}

Did this answer your question?