Skip to main content
The Zen Parse Expression command (Command Type: 1020) evaluates Zen expressions or unary conditions against the current input data context.

Overview

The Zen Parse Expression command provides functionality for:
  • Evaluating expression type Zen expressions that return transformed data
  • Evaluating unary type boolean conditions against the root context ($)
  • Storing results in the data field or children array

Command Type

Command Type ID: 1020

Parameters

ParameterTypeDescriptionRequired
evaluationTypestringThe type of evaluation. "expression" returns transformed data; "unary" evaluates a boolean condition against $. Possible values: "expression", "unary"Yes
expressionstringThe Zen expression to evaluate. For expression: use object construction like ( key: value ). For unary: use boolean conditions like $.value > 10Yes
timeoutnumberTimeout for the evaluation in millisecondsYes
keystringWhere to store the result. "data" (default) stores in data field; "children" stores in children array (must be array). Possible values: "data", "children"No

Usage Examples

Evaluate an Expression

{
  "command": "zen-parse",
  "params": {
    "evaluationType": "expression",
    "expression": "( id: $.eventId, name: $.eventName )",
    "timeout": 5000
  }
}

Evaluate a Unary Condition

{
  "command": "zen-parse",
  "params": {
    "evaluationType": "unary",
    "expression": "$.odds > 1.5",
    "timeout": 3000
  }
}

Output to Children Array

{
  "command": "zen-parse",
  "params": {
    "evaluationType": "expression",
    "expression": "$.items.( id: id, label: name )",
    "timeout": 5000,
    "key": "children"
  }
}

Evaluation Types

TypeDescriptionExpression Example
expressionReturns transformed data using object construction syntax( id: $.id, value: $.price * 1.1 )
unaryReturns a boolean — evaluates a condition against root context $$.status = 'active'

Output Key Options

ValueBehaviour
"data"Stores the result in the data field (default)
"children"Stores the result in the children array — result must be an array

Common Use Cases

  • Conditional Filtering: Use unary mode to evaluate pass/fail conditions in the pipeline
  • Data Reshaping: Use expression mode to produce a new object structure
  • Lightweight Transforms: Apply simple Zen expressions without the full JDM graph overhead
  • JSONata - Evaluate JSONata expressions against input data
  • Transform By JDM - Transform data using full JDM rules
  • Filter - Filter collections based on field values