Runscript

This help page is for CXone Studio. This information is also available for Desktop Studio.

Continues script execution to a new script as if it were an extension of the calling script.

One of the benefits of using Runscript is that you can create smaller scripts instead of having one large script.

Dependencies

  • The main script and the subscript must be contained in the same folder.
  • The main script type and the subscript type must be the same. For example, if the main script is a phone script, the subscript must also be a phone script.
  • The ContactID will be the same for both the main script and the subscript.
  • After Runscript triggers the subscript, the main script passes execution to the second script and no longer runs. If you want both scripts to run simultaneously, use a Spawn action. All variables from the first script are left intact in the second script.
  • If you intend to run another script and return to the first script upon completion, including the ability to pass and return values (like a programming subroutine), use Runsub action.
  • The main script will terminate when Runscript triggers the subscript.
  • All scripts called by RunScript , Spawn, Runsub, or similar scripts must be valid and active. During the save process, Studio validates all scripts called by actions. If any of them are invalid or inactive, Studio displays an error and you won't be able to save.

Supported Script Types

A square with a line branching from it that goes to three other squares.

Generic

Email Chat Phone Voicemail Work Item SMS

Input Properties

These properties define data that the action uses when executing.

Property

Description

Add Caption

Enter a short phrase that uniquely identifies this action in the script. The caption appears on the script canvas under the action icon.

Script Name

The script you want to spawn. You can click the Choose Script link at the top of the action's properties box to select a script from your business unit.

Result Branch Conditions

None

Script Example

This is an example to show how this action can be used in scripts. It is not intended to be a complete script. Additional scripting may be required.

The following example is a part of a much larger script. In this example, Runsub triggers a different script, in which the Return action enables the Case action in the script below to determine whether the organization is open, closed, or on holiday. If it is determined that the office is closed or on holiday, a Play action will play a specific message (either a closed message or a holiday message). The Runscript will then terminate the script and trigger the subscript.

An example script, showing Studio actions with arrows connecting them. Each action has a label beneath it to indicate what the action does in the script.

Would you like to download this script?

The subscript that Runscript triggers is shown below. The script enables the contact to leave a message. The main script passed a variable with the caller ID and contact IDClosed A unique numerical identifier assigned to each contact to the subscript, which enables the contact to leave a message, review a message, take corrective action if no voice was heard, or to enable the contact to re-record their message.

An example script, showing Studio actions with arrows connecting them. Each action has a label beneath it to indicate what the action does in the script.

Would you like to download this script?