Help files

If/Else/EndIf

The most common way to control which actions of your Process will be executed is to use the “If” action. This action checks whether or not a certain condition is true. If so, the action or block of actions, that are included between “If” and “End If”, will be executed.

An “If” statement consists of 2 operands (the operands are the pieces of information that will be compared) and an operator. The operator can be:

  • “is equal to” (=),

  • “is not equal to” (<> or !=),

  • “is greater than” (>),

  • “is greater or equal to” (>=),

  • “is smaller than” (<)

  • “is smaller or equal to” (<=)

  • Starts with

  • Does not Start with

  • Contains

  • Does not contain

  • Ends with

  • Does not End with

  • Is Empty

  • Is not Empty

and it defines how the first operand should relate with the second operand in order for the condition to be met.

An “If” statement may optionally contain an “Else” action. This action should always be placed between an “If” and an “End If” action, and it defines the action or set of actions that will be executed if the condition that is defined by the “If” statement is not met. Basically, you will have to place the actions that will be executed if the condition is met between “If” and “Else”, and the actions that will be executed if the condition is not met between “Else” and “End If”.

You can also use the "Else If" action (which can be placed within the If/End If block and always before the Else action) to set mutually excluded conditions for which different blocks of actions need to be executed.

Note: If the first and the second operands are variables, you will have to make sure that they have the same data type or the condition will, most likely, not be met (or it will always be met if you used the <> operator). For example, if your conditional checks whether a variable of Date Time type is equal to a variable that contains a file, this condition will never be met, hence the set of actions contained in the conditional will never be executed.