Add an If Action

You use this action to add If, Else and Else If conditions.

To use an If action:

  1. Add the action in one of three ways, depending on your preference and where you want it added:
    • Drag the action from the Actions palette onto the canvas, dropping the action either at the bottom edge of the action it is to follow, or at the top edge of the action it is to precede.
    • Double-click the action in the Actions palette to add it to an empty canvas or to the end of an action chain.
    • On the canvas, select the action you want the new action to follow, then double-click the new action in the Actions palette.
  2. With the If block selected on the canvas, add a condition using the Condition property. As a reminder, enclosing the expression in double curly brackets in the Properties pane indicates that it's a direct expression and not a string.

  3. Add the action to take for the If block to the Add Action area. You can either select the block and double-click the action, or you can drop the action onto the Add Action area. If another action is to follow, double-click the next action, or drop it onto the bottom edge of the preceding action.

  4. To add an Else or Else If condition, drop the action to take for the condition onto the Create Branch area at the bottom of the If block, which appears when you hover over it with an action.

  5. By default, an Else condition is created. To turn the Else into an Else If condition, enter a condition for it in the Properties pane:

  6. To add an Else or another Else If condition, drop the first action to take for the condition onto the Create Branch area of the Else If block. Again, an Else condition is created by default, but it can be turned into an Else If by entering a condition in the Properties pane.

    Here's the completed example: