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

Assigns a unique value to a user-defined variable.

Supported Script Types

The icon for a Generic script type - a rectangle with < and > symbols inside it.

The icon for the Email script type - a large @ symbol in a diamond.

The icon for the Chat script type - a chat bubble with an ellipsis inside (...), in a diamond shape.

The icon for the Phone script type - an old-style phone handset with curved lines indicating sound coming out of it.

The icon for the Voicemail script type - a symbol that looks like a cassette tape - two circles sitting on a horizontal line.

The icon for the Work Item script type-a piece of paper with one corner folded down and a bullet list on it.

The icon for the SMS script type - a smart phone with a chat bubble coming out of it.

The icon for the Digital script type - a computer monitor with a smartphone next to it.


Email Chat Phone Voicemail Work Item SMS Digital

Input Properties

These properties define data that the action uses when executing.




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

Variable The name of the variable that you want to hold the value.
Value The value or data to be stored.
Type Choose from String, Numeric, or Datetime. The type you select here changes the Value property to interpret the data entered in the Value field. For example, if you select String and enter the value 1+1, the actual value assigned to the variable is 1+1. However, if you select Numeric and enter the value 1+1, the value assigned to the variable is 2.

A property of the variable you create. When set to true, the variable's value appears in the default screen popClosed A configurable pop-up window with information about the contact. It appears on an agent's screen after a certain event, usually when the agent connects to a contact. displayed for the agent. The Use Screen Pop option must be enabled for the current ACD skillClosed Used to automate delivery of interactions based on agent skills, abilities, and knowledge . Select True to enable the display of this value in the default screen pop. The default is False.

This option does not work with digitalClosed Any channel, contact, or skill associated with Digital Experience. scripts. If you want to use screen pops with digital scripts, use the POPURL action or the RUNAPP  action.


A property of the variable you create, which controls whether the variable's value is saved to the CXone platform database. You can access the stored data in two ways: 

You can also use the savetodb() variable property when working with variables in Snippet actions.

Select True to enable this value to be saved in the database. The default is False.

MaxStringSize The maximum size in KB of the value that can be stored. The default size is 2 KB.

Result Branch Conditions

Result branch conditions allow you to create branches in your script to handle different outcomes when an action executes.



Default Path taken unless the script meets a condition that requires it to take one of the other branches. It is also taken if the action's other branches are not defined.
Overflow Path taken if the value assigned to the variable exceeds the maximum string size.

Tips & Tricks

  • Use Assign to set the contents for either string or numeric variables.
  • Learn about using the Assign action to add or edit the value of a variable on the Variables help page.
  • Script variable values will automatically be merged or pre-populated into the Quick Reply variables in the agent application when the variable names match and the script Assign action is set to ScreenPop = true. If variable values are successfully merged, agents will retain the ability to manually modify the pre-populated Quick Reply fields. The total amount of variable data configured to ScreenPop should not exceed 200 KB. Larger amounts of data may slow the agent application's performance.
  • Create a global variable in a subscript by including the keyword global in front of the variable name. For example: Global:varName

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.

Begin triggers a Menu that provides three options, press 1 for Sales, 2 for Support, or 3 for Account Management. When the user selects an option, the script uses a specific Assign action to assign a value for the Skill ID that Countagents uses to determine the number of agents logged in with that skill. The If action then uses an expression, TOTAL=0, to determine which branch to take if agents are logged in. TRUE means the total agents logged in does equal 0 for that ACD skill, and the script will run a separate script for leaving a message. FALSE means the total agents logged in does not equal 0, and Reqagent uses the variable value in Assign to request an agent with the skill (via the Skill ID in Newskill).

Download this script.