Use variables in a script

You must:

Defining a local variable

1.

Select the Variables button on the Panel selector.

2.

Expand the Local Variable item and then double-click the variable type to create (for example, string).

3.

Name the variable. This must be unique in the script, begin with a letter, contain the characters a-z, A-Z, 0-9 or _ (underscore), and not contain spaces. It is recommended that you include a prefix to help other users to identify the variable type at a glance. The following 'Hungarian notation' is used by programmers:

Prefix

Variable type

Description

sz

String

Stands for 'zero-terminated string'.

l

Integer

Stands for 'long integer'.

f

Float

Stands for 'floating point' variable.

dt

Date/time

Stands for 'date/time'.

b

Boolean

Stands for 'Boolean' flag.

Constant variables (whose values are not expected to change within a service) are typically named in upper case. For example, 'lVAT_VALUE' and 'szDR_NUMBER'.

4.

If the variable is required to have a starting (initial) value, enter this in the Value field.

5.

Click Apply.

Note: you can also create a structured Call Data local variable to store system-generated call data (see the call data system variable) for use in an Outbound Call action cell.

Note: for a date variable, you must complete the following fields with valid values:

Note: to delete a variable, click it in the Variables panel and then press Delete on your keyboard.

Using the variable

Either type the name of the variable in an action cell field that supports variables or drag it directly from the Variables panel and onto the target field.

Note: A red-bordered field indicates an undefined variable:

Some action cells accept only individual date-time elements rather than the entire date structure. To use a date variable in such a cell (for example, in the Fill Date action cell), expand the desired date variable in the Variables panel and then drag a date element to the target field in the action cell's properties:

Note: leaving a date element empty causes the value to be converted to zero. This may be regarded as an invalid date format and may cause action cells such as Compare Variables to error.