Scenario
In some cases, the value of a variable depends on the content of the incoming request. There are two approaches to conditional value assignment:- Row Condition: Execute the row only when a specific condition is met.
- JEXL Ternary Expression: Decide which value to assign within a single row.
Approach 1: Conditional Row Execution
Row conditions allow you to execute a row only when a specific condition is true. For the “false” case, set the default value as the fallback.Example: Different Label Based on Status
AssignACTIVE if the status field in the request body is active, otherwise assign PASSIVE.
Row 1 — Default value (always runs):
Row 2 — Override when condition is met:
Result
Approach 2: JEXL Ternary Expression
A ternary expression makes the decision within a single row using thecondition ? trueValue : falseValue syntax.
Example: Operation Type Based on HTTP Method
Result
Approach 3: Conditional JSON Part Generation
Generating an optional JSON object conditionally is one of the most powerful use cases. This is achieved by combining row conditions with custom variables.Scenario
Include ametadata object in the body only if the type field in the request body is premium.
Row 1 — Default: empty JSON string:
Row 2 — Override with row condition:
Row 3 — Final body template:

