Define a custom script action


  1. Click Actions.

  2. To add an action, click .

    click-add-action

  3. Type a name for the new action.

  4. Click Add Step. A list of previously defined actions appears, along with two other options:

    • If/Else: Evaluates a condition before executing an action.

    • Delay: Allows you to postpone the progression of a custom action for a certain amount of time.

      An action can execute one or more steps in sequence. Each step is a built-in action or a custom action. Actions can evaluate variables to determine whether steps execute.

  5. Do one of the following:


    Select the action name.

    The selected action appears in the editor.


    An if/else construct allows an action to carry out different steps based on the run-time value of a variable.

    1. Click If/Else. An expression editor appears.

      Image of the expression editor

    2. Under Left Hand Side, select the variable whose run-time value compares to something else.

    3. Next, select which operator to use for the comparison.

      Shows list of logical operators

    4. Click the options menu for Right-Hand Side.

      right-hand-side-menu

      To select what to compare the Left Hand side variable to, choose Interpolated TextText Expression, or Variable.

      • Interpolated Text: Evaluates a string that contains the runtime value of one or more placeholders.
      • Text Expression: Compares to the result of a logical expression. See Dynamic variables.
      • Variable: Compares to the runtime value of a variable.
    5. Based on your selection, type text in the input box or choose a variable.

    6. Click Add Step, and then choose a built-in or custom action to execute when the expression evaluates True. Add any other steps to carry out when the expression is True.

    7. To define steps to take when the expression is False, click Add Step under Else. This process defines an alternate series of steps that the action can take, based on the value of the Left Hand Side variable. When you finish, the expression editor looks similar to this figure.

      Example of a completed conditional expression

      In this example, if the value of variable MyVariable equals “Made Sale,” Page Duo page appears. Otherwise Page 1 page appears.

      Note: The bottom-most Add Step button performs a special function. It defines additions steps for the action to take after actions in the conditional expression run. In programming terms, this behavior is equivalent to lines of code that follow an if…then…else expression. These steps always execute when the action is invoked, regardless of the variable’s value.

    1. Select Delay.

    2. Enter the amount of time to delay in milliseconds. Choose whether that amount is as an integer, math expression, or variable.

    3. Click Add Step.

  1. Add other steps as needed.
  2. If you create multiple steps, you can use the up and down arrows to reorder them. Steps execute in top down order.Figure shows how to move steps up or down.

    Tip: To delete a step, click

  3. When you finish, click Save.