To add a custom script action, follow these steps:

  1. Click Actions .

  2. To add an action, click Add Action .

  3. Type a name for the new action.

  4. Click Add Step.

    Note: 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 run.

  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 execute different steps based on the runtime value of a variable.

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

    2. Under Left Hand Side, select the variable whose runtime value compares with something else.

    3. Next, select the Operator to use for the comparison.

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

      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 with the result of a logical expression. See Dynamic variables.
      • Variable: Compares with 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 run when the expression evaluates True. Add any other steps to execute 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. 

      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 runs, regardless of the variable’s value.

    A delay allows you to suspend the execution of an action for a specified amount of time.

    1. Select Delay.

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

    3. Click Add Step.

    A Try/On Error expression allows you to determine what happens if an error occurs when you attempt to do something.

    1. Click Try/On Error. An expression editor appears.
    2. Under Try, click Add Step, and then choose a built-in or custom action to execute. Add any other steps to execute when the expression is True.
    3. Under On Error, click Add Step, and then choose a built-in or custom action to execute when the Try action results in an error.
    4. Click Add Step.

    Note: You cannot currently expose a variable that returns the actual error from the Try action.

    An Add an Info Banner action allows you to display text to the agent for the amount of time the action takes to execute.

    1. Click Info Banner. A text editor appears.
    2. Type or paste the text you want to appear in the banner.
    3. Click Add Step.
      Note: To display the banner for a specific amount of time, be sure to add a Delay 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.
    3. To finish, click Save.

    Tips:
    • To delete a step, click Delete Step .
    • To cut a selection, click Cut .
    • To copy a selection, click Copy .
    • To collapse an action, click Collapse .
    • To open a collapsed action, click Expand
    • To modify an existing custom action, click Edit Custom Action
    • To convert an existing action to a custom action, from the action, click Convert to Custom Action .