Skip to content

Boolean Operators

Boolean operators in BizzStream allow you to define boolean relationships and conditions to control document behavior and layouts dynamically.

This guide covers essential Boolean operators, including AND, OR, NOT, ISBLANK, EXISTS, IF, and INCLUDES, enabling you to create complex conditions and make decisions based on field values.


AND Operator

The AND operator returns true if all provided conditions are true. If any condition is false, it returns false. It does not support type coercion. This means any non-boolean argument will become false.

Syntax

AND(boolean_expression1, [boolean_expression2, ...])
  • boolean_expression1 - An expression or pointer to a field containing an expression that represents some boolean value, i.e. TRUE or FALSE.
  • boolean_expression2, ... - [ OPTIONAL ] - Additional expressions or pointers to a fields containing expressions representing some boolean values, i.e. TRUE or FALSE.

Examples

  • AND(F["approvalDate"] = "2023-05-01", F["name"] = "Joe Smith")
    • Returns true if both conditions are met.
  • AND(F["completed"], F["name"] = "Joe Smith")
    • Returns true if "completed" is true and "name" is "Joe Smith".
  • AND(true, false)
    • Returns false because one condition is false.
  • AND(true, 1)
    • Returns false the second argument is not boolean.

OR Operator

The OR operator returns true if at least one of the provided conditions is true. If all conditions are false, it returns false. It does not support type coercion. This means any non-boolean argument will become false.

Syntax

OR(boolean_expression1, [boolean_expression2, ...])
  • boolean_expression1 - An expression or pointer to a field containing an expression that represents some boolean value, i.e. TRUE or FALSE.
  • boolean_expression2, ... - [ OPTIONAL ] - Additional expressions or pointers to a fields containing expressions representing some boolean values, i.e. TRUE or FALSE.

Examples

  • OR(F["approvalDate"] = "2023-05-01", F["name"] = "Joe Smith")
    • Returns true if at least one condition is met.
  • OR(F["completed"], F["name"] = "Joe Smith")
    • Returns true if "completed" is true or "name" is "Joe Smith".
  • OR(true, false)
    • Returns true because one condition is true.

NOT Operator

The NOT operator negates a Boolean expression, returning the opposite value. It does not support type coercion. This means any non-boolean argument will become false.

Syntax

NOT(boolean_expression)
  • boolean_expression - An expression or pointer to a field containing an expression that represents some boolean value, i.e. TRUE or FALSE.

Examples

  • NOT(true)
    • Returns false
  • NOT(F["completed"])
    • Returns false if "completed" is true.

ISBLANK Operator

The ISBLANK operator checks if a field or expression is empty. It returns true for: undefined, null, "" (empty string) or [] (empty array).

Syntax

ISBLANK(value)
  • value - An expression or pointer to a cell that will be checked for emptiness.

Examples

  • ISBLANK(undefined)
    • Returns true
  • ISBLANK(null)
    • Returns true
  • ISBLANK("")
    • Returns true
  • ISBLANK([])
    • Returns true
  • ISBLANK(F["name"])
    • Returns true if "name" has no value.

EXISTS Operator

The EXISTS operator checks if a field has a defined value (i.e., not undefined).

Syntax

EXISTS(value)
  • value - An expression or pointer to a cell that will be checked.

Examples

  • EXISTS(undefined)
    • Returns false
  • EXISTS(null)
    • Returns true
  • EXISTS("")
    • Returns true
  • EXISTS([])
    • Returns true
  • EXISTS(F["name"])
    • Returns true if "name" is defined.

IF Operator

The IF operator evaluates a condition and returns one value if true and another if false.

Syntax

IF(boolean_expression, value_if_true, value_if_false)
  • boolean_expression - An expression or pointer to a field containing an expression that represents some boolean value, i.e. TRUE or FALSE.
  • value_if_true - An expression or pointer to a field.
  • value_if_false - An expression or pointer to a field.

Examples

  • IF(true, 1, 0)
    • Returns 1
  • IF(ISBLANK(F["name"]), "No name", "Name exists")
    • Returns "No name" if "name" is blank, otherwise "Name exists".

INCLUDES Operator

The INCLUDES operator checks if one value exists within another (string or array).

Syntax

INCLUDES(expression1, expression2)
  • expression1 - An expression or pointer to a field.
  • expression2 - An expression or pointer to a field.

Examples

  • INCLUDES("The quick brown fox", "fox")
    • Returns true
  • INCLUDES([1, 2, 3, 4], 4)
    • Returns true
  • INCLUDES([1, 2, 3, 4], [4, 8])
    • Returns true (because 4 is included)
  • INCLUDES(true, true)
    • Returns true
  • INCLUDES({}, {})
    • Returns true (empty objects are equal)

Summary

Operator Description
AND Returns true if all conditions are true.
OR Returns true if at least one condition is true.
NOT Negates a Boolean value.
ISBLANK Checks if a value is undefined, null, or empty.
EXISTS Checks if a value is defined.
IF Returns different values based on a condition.
INCLUDES Checks if one value exists within another.

These Boolean operators enable powerful logic in BizzStream expressions, making documents and layouts more dynamic.