You can add custom code to an interaction. The code can be executed before the interaction runs, after the user has responded to the interaction, or after the interaction runs.

Custom code indicator

An interaction that contains custom code displays a green dot:

Check for this to understand at a glance whether there's code in the Pre-Process Code, Process User Response code, or Post-Process Code in the interaction.

You'll also see this green dot next to the name of any code tab that contains custom code:

Access the Custom Code panel

  1. Select the interaction.
  2. In the interaction's upper-right corner, click (Custom Code icon).

    This displays the Custom Code panel.

There are three tabs for adding code:

  • Process User Response
  • Pre-Process Code
  • Post-Process Code

Use the desired tab to add the code. You can use the built-in scripting functions to access variables and manipulate data.

Pre-Process Code

Use this area to add JavaScript code that executes before the interaction runs. This can be useful for any kind of processing you want to do before executing the interaction.

Process User Response

Use this area to add JavaScript code that executes after the user has responded to the interaction. This code can be used in place of the response conditions, or in conjunction with them after a successful match.

Post-Process Code

Use this area to add JavaScript code that executes after the interaction runs. This can be useful for any kind of processing you want to do after executing the interaction.