Putvalue

Stores and retrieves data in a NICE CXone database table in order to make it accessible to other scripts and contacts. This data can be retrieved with the GETvalue action.

 

Supported Script Types

Related Actions

These database, table, or list actions store and retrieve data in a database table in order to make the data accessible to other scripts; it behaves like a list of fields or values. Use them for storing multiple values, or values needed further along in other scripts. The values are listed in a table temporarily from 1 hour to 168 hours (7 days). The default TimeToLive (TTL) is 24 hours; however, you can manually remove (delete) the data to maintain complete control within your scripts.

These actions utilize a unique data type that can only be accessed using the appropriate Studio actions: Putvalue, Getvalue, Remvalue, Getlist, and Clearlist. The data are not accessible any other way. Users cannot get to this database and use it, regardless of their permissions.

Notes:

  • If several variables need to be accessed by other scripts/contacts, a database is generally the best solution.
  • Non-persistent public variables can be shared by other scripts/contacts throughout the life of the script that sets those variables. The variables are automatically cleaned up once they are released.

Properties

Property Details
Scope

Select the level that the values this action handles are visible to other contacts. Only contacts that share the same scope will be able to access the same data. Options are: 

The Scope you select must match the Scope set in all other list actions that you include in your script. The list actions are Putvalue, Getvalue, Remvalue, Getlist, and Clearlist. Even when the Name of the list is the same, they will not be recognized if the Scope settings do not match.

Name

The used to identify the value. This can be any name or number. Names are not case sensitive. When the value is retrieved using Getvalue, Name must be the same. If the Name property does do not match, they will not recognize each other, even if the Scope setting is the same.

Value

The value or data to be stored.

Method

When multiple values with the same name are stored, they are put in a list. Select one of the following methods:

  • ReplaceAll—This is the default value and will be automatically selected.
  • Append—Places the new value at the end of the list. When appending values, if the number exceeds 1000 appends in less than 24 hours, it will no longer append until some of the appends clear (after 24hrs).
  • Insert—Places the value at the beginning of the list. Subsequent calls to Getvalue will retrieve data from the beginning of the list.
Persistent

Select True if you want data stored by a given contact to remain after the contact is released. The default is for data to be removed when the contact is released (False).

TTL (hrs)

Set this property to the amount of time in hours that you want the data to be available. When the TTL (Time to Live) is reached, the data is cleared. The actual time when data is cleared may be up to one hour after the TTL expires. This is because the process that checks for TTL runs once per hour, at the start of the hour. For example, if the TTL expires at 10:03, the process that checks for TTL expiration won't run until 11:00, which means that the data will continue to exist until 11:00.

The minimum value for this property is one hour and the maximum is 168 hours (seven days). The default is 24 hours. Setting values outside the allowable limits causes the action to use the nearest allowable value.

Branches

Branch Details

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 other branches are not defined.

Tips & Tricks

  • Putvalue utilizes a unique data type that must be accessed using the appropriate Studio actions: Putvalue, Getvalue, Remvalue, Getlist, and Clearlist.
  • When the Persistent property is set to False, all public values that were added by a specific contact are automatically removed when the contact is released. This feature is commonly used when a parent script needs to keep track of spawned child scripts. Each child script will Putvalue with the Name property such as "{MasterID}List" and a value of {ContactID}. Because the "{MasterID}List" is public, the parent script can periodically execute Getlist to discover how many child scripts are currently running. By virtue of the Persistent=false property, the child script's public value will automatically be removed when released. No extra work is required to maintain an accurate count of child scripts.
  • If several variables need to be accessed by other scripts/contacts, a database is generally the best solution.
  • Non-persistent public variables can be shared by other scripts/contacts throughout the life of the script which sets those variables. The variables are automatically cleaned up once they are released.
  • Persistent variables must be manually removed by executing Getvalue (with the Remove property set to “true”), Remvalue, or Clearlist. It is not recommended to use Putvalue for large amounts of data or data you will need for long periods of time. If you need to save data, it is recommended that you use and DB Connector and connect to a database that you control.