If / Else

Perform conditional logic based on variable contents
Preview
Preview

Parameters

Variablerequired
Text

Enter the variable / argument name to test

If the variable does not exist, the entire sub-action will be skipped unless you are using the Does Not Exist operator.
Operatorrequired
Select
default:Equals

Choose the type of test to perform on the selected variable

  • Equals: Check if the variable equals a given value
  • Not Equals: Check if the variable does not equal a given value
  • Contains: Check if the variable contains the given value
  • Regex Match: Use a Regular Expression to match variable contents
  • Less Than: Check if a numeric variable is less than a given value (does NOT include the set value)
  • Greater Than: Check if a numeric variable is greater than a given value (does NOT include the set value)
  • Does Not Exist: Check if the variable name is defined at all
  • Equals (Ignore Case): Check if a string variable equals a given value, case insensitive
  • Not Equals (Ignore Case): Check if a string variable does not equal a given value, case insensitive
  • Is Null or Empty: Check if a variable is Null or empty
Regular Expressions (RegEx) are extremely powerful!
You can use tools like regex101 and RegExr to view and test your expressions.
Auto Type
Toggle
default:false

By default, values which have not already been typed are treated as text, or string variables.

Enable Auto Type to automatically determine the type for the variable value.

For example:

  • 0 can be auto-typed to a numeric type such as int or long
  • true or false can be auto-typed to a bool
Valuerequired
Text

Enter the value you would like to use for comparison.

This can contain other %variables%

You cannot use ~globalVariables~ directly. Use the Global Get sub-action to first load it into a local argument.
Do Action
Select
default:None

Select an action to execute if the comparison is true

Run Action Immediately
Toggle
default:true

By default, the selected action will be executed outside of its normal queue and treated as a subroutine of the current action, waiting for completion before moving on to the next sub-action.

Disable this option to queue the action as normal and immediately move on to the next sub-action

Then
Select
default:Continue

Choose whether or not the current action should continue if the comparison was true

  • Continue: Continue execution as normal, moving on to any subsequent sub-actions
  • Break: Stop the current action, any subsequent sub-actions will not be executed.
Else Condition -> Do Action
Select
default:None

Select an action to execute if the comparison is false

Else Condition -> Run Action Immediately
Toggle
default:true

By default, the selected action will be executed outside of its normal queue and treated as a subroutine of the current action, waiting for completion before moving on to the next sub-action.

Disable this option to queue the action as normal and immediately move on to the next sub-action

Else Condition -> Then
Select
default:Continue

Choose whether or not the current action should continue if the comparison was false

  • Continue: Continue execution as normal, moving on to any subsequent sub-actions
  • Break: Stop the current action, any subsequent sub-actions will not be executed.