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.
TRUEorFALSE. - boolean_expression2, ... - [ OPTIONAL ] - Additional expressions or pointers
to a fields containing expressions representing some boolean values, i.e.
TRUEorFALSE.
Examples
AND(F["approvalDate"] = "2023-05-01", F["name"] = "Joe Smith")- Returns
trueif both conditions are met.
- Returns
AND(F["completed"], F["name"] = "Joe Smith")- Returns
trueif"completed"istrueand"name"is"Joe Smith".
- Returns
AND(true, false)- Returns
falsebecause one condition isfalse.
- Returns
AND(true, 1)- Returns
falsethe second argument is not boolean.
- Returns
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.
TRUEorFALSE.
Examples
OR(F["approvalDate"] = "2023-05-01", F["name"] = "Joe Smith")- Returns
trueif at least one condition is met.
- Returns
OR(F["completed"], F["name"] = "Joe Smith")- Returns
trueif"completed"istrueor"name"is"Joe Smith".
- Returns
OR(true, false)- Returns
truebecause one condition istrue.
- Returns
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
- Returns
NOT(F["completed"])- Returns
falseif"completed"istrue.
- Returns
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
- Returns
ISBLANK(null)- Returns
true
- Returns
ISBLANK("")- Returns
true
- Returns
ISBLANK([])- Returns
true
- Returns
ISBLANK(F["name"])- Returns
trueif"name"has no value.
- Returns
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
- Returns
EXISTS(null)- Returns
true
- Returns
EXISTS("")- Returns
true
- Returns
EXISTS([])- Returns
true
- Returns
EXISTS(F["name"])- Returns
trueif"name"is defined.
- Returns
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
- Returns
IF(ISBLANK(F["name"]), "No name", "Name exists")- Returns
"No name"if"name"is blank, otherwise"Name exists".
- Returns
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
- Returns
INCLUDES([1, 2, 3, 4], 4)- Returns
true
- Returns
INCLUDES([1, 2, 3, 4], [4, 8])- Returns
true(because4is included)
- Returns
INCLUDES(true, true)- Returns
true
- Returns
INCLUDES({}, {})- Returns
true(empty objects are equal)
- Returns
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.