Skip to main content

If

Sophie avatar
Written by Sophie
Updated this week

Definition and Usage

Check a condition and execute actions if true. The If command allows you to create conditional logic in your automation workflow, executing specific actions only when the defined condition evaluates to true.


Parameter Values

Input parameters

Parameter Name

Description

Possible Values

Required

Options / Notes

First operand

Enter a variable, expression, text, number, or symbol created by a previous command to compare with the second operand

Any value

Yes

Supports variable insertion

Operator

Choose the relationship between the first and second operand

Equals to (=), Not equal to, Greater than (>), Greater than or equal to (>=), Less than (<), Less than or equal to(<=), Contains, Does not contain, Is empty, Is not empty, Is true, Is false, Starts with, Does not start with, Ends with, Does not end with

Yes

Select the appropriate comparison operator

Second operand

Enter a variable, expression, text, number, or symbol created by a previous command to compare with the first operand

Any value

Yes

Supports variable insertion

Ignore case

When checked, string comparisons will ignore letter case

True/False

No

Useful for text-based comparisons

Variables produced

This action doesn't produce any variables.


Using Variables in Conditions

  • Variables can be inserted into both the First operand and Second operand fields by clicking the {x} button or selecting from previously created variables.

  • When using variables in conditions, ensure that the variable type is compatible with the comparison operator you've selected.

  • Text variables work with all text-based operators like "Contains", "Starts with", "Ends with".

  • Numeric variables work best with mathematical comparison operators like ">", "<", "=".

  • Boolean variables work with "Is true" and "Is false" operators.


Notes

  • The If command must be paired with an End If command to close the conditional block.

  • Any commands placed between the If and End If will only execute if the condition evaluates to true.

  • For more complex conditions, consider using nested If statements or the If Else command.

  • When comparing text values, consider using the "Ignore case" option to make comparisons case-insensitive.

  • Empty strings and null values are treated differently; use the appropriate operator ("Is empty" or "Is null") based on your needs.

Did this answer your question?