Creates conditional logic in DAZL scripts, enabling dynamic execution paths based on evaluated conditions. Acts as a flow control mechanism for branching data pipelines.
When to Use
Implement conditional processing logic in data pipelines
Create different processing paths based on data characteristics
Skip steps when certain conditions are not met
Handle special cases with custom processing
Build decision trees for complex data transformations
Execute different analysis methods based on dataset properties
Implement error handling and fallback processing
How It Works
Takes a logical condition expression and two possible execution branches
Evaluates the condition expression using a safe evaluation method
Executes either the "then" branch (if condition is true) or the "else" branch (if false)
Each branch can contain multiple nested steps that are executed sequentially
Returns the results from the executed branch, maintaining the data contract
Provides debugging information about condition evaluation and branch selection
Parameters
Required
condition (string) - Logical expression to evaluate (must resolve to true/false)
then (object) - Container for steps to execute when condition is true:
steps (array) - List of step definitions to execute
Optional
else (object) - Container for steps to execute when condition is false:
steps (array) - List of step definitions to execute