Skip to main content

$return

The $return operator returns a value from the current execution context, typically used for early exits from blocks.

Input

  • An optional single value to return (if omitted, returns null)

Output

  • The specified value, which causes an early exit from the containing block

Examples

Return Specific Value

Result: "x is greater than 5" if x is greater than 5

Return Without Value

Result: null

Return Field Value

Result: The error_message field if status is “error”, otherwise the result field