NOT

NOT(value)[source]

Returns True if the input is False, and False if the input is True.

This function performs a logical negation (NOT) on the provided input. If the value is True, the result is False; if the value is False, the result is True. The input may be a boolean literal, field, formula, calculation, or parameter. When the input is an array, the result is an array of boolean values computed element-wise.

Parameters:

value (Operand | bool) –

A boolean or boolean-compatible input to negate.

Supported types:

  • BOOLEAN

  • BOOLEAN_ARRAY

  • INTEGER

  • INTEGER_ARRAY

  • DECIMAL

  • DECIMAL_ARRAY

Return type:

Formula

Returns:

The logical negation of the input. Returns an array if the input is an array.

Supported types:

  • BOOLEAN

  • BOOLEAN_ARRAY

Raises:

ValueError – If the input is not boolean-compatible.

Examples

Basic usage with literals:

NOT(True)
# Returns False

Usage with a field:

NOT(order["is_cancelled"])
# Returns True if the order is not cancelled

Element-wise operation with arrays:

NOT([True, False])
# Returns [False, True]