Skip to content

If

Overview

The If component can evaluate an expression involving variables and direct the flow of an orchestration job depending upon whether the expression evaluates to "true" or "false".

The If component has three output connectors. A blue (top) connector is followed when the expression evaluates to "true". An orange (center) connector is followed when the expression evaluates to "false". The red (bottom) connector is followed if a runtime error occurs during evaluation.

Variables involved in the expression must be declared in advance as job variables.

For similar flow components, see the And component and the Or component.


Properties

Name = string

A human-readable name for the component.


Mode = drop-down

Select:

  • Simple: Uses the Condition and Combine Conditions properties to define an expression.
  • Advanced: Provides a code editor to write your own JavaScript expression.

Condition (Simple mode) = column editor

Click + to add a condition. Any number of conditions can be added; the Combine Conditions property will define how they work together.

For each condition, enter the following:

  • Input Variable: The variable to use in the comparison. If the input variable is null, it will be considered blank.
  • Qualifier: Select Is or Not. Not reverses the meaning of the comparator; for example, changing an "Equals" to a "Does Not Equal" expression.
  • Comparator: Select the comparison operator.
  • Value: Most commonly a constant value, but can also be a variable reference or expression. The value is parsed according to the type of the input variable.

Only used if Mode is Simple.


Combine Conditions = drop-down

Use the defined conditions in combination with one another according to either "And" or "Or". Only used if Mode is Simple.


Condition (Advanced mode) = code editor

A JavaScript expression, which will be evaluated to determine whether it's true or false. If the expression isn't itself a true or false value, then any non-empty string is considered true, as is any non-zero number.

Only used if Mode is Advanced.

Note

  • JavaScript expressions are only available to use as parameter values within Matillion ETL components. Any valid single JavaScript expression may be used; however, it is recommended that only simple expressions are used. All variables defined in the job and/or environment should also be available to reference.
  • When entering values into a component's parameter editor, everything enclosed within ${ } of the literal string will be evaluated immediately. This validation process currently does not take variables into account and may assume the value is incorrect.

Video


Snowflake Delta Lake on Databricks Amazon Redshift Google BigQuery Azure Synapse Analytics