Show TOC

Background documentationWorking With Variables Locate this document in the navigation structure

 

A set of variables is associated with every voice model. All these variables are stored in the Visual Composer voice kit repository known as the dataStore. The Visual Composer Voice kit provides you with a Variable Manager that you can use to add, delete, and rename variables in the dataStore. The values in these variables can in-turn be used in the voice entities or the non-voice entities. You can create variables with the following data types:

  • String

  • Boolean

  • Number

  • Date

  • Time

  • Record

  • Table

The dataStore also provides with a set of environment variables that are set at runtime. Developers can use these to check if the variables are set as expected at runtime.

To launch the Variable Manager work through the following steps:

  1. In the workspace of a voice model, select dataStore.

  2. Using the secondary mouse button, choose Define Data.

Table Data

Tables are multirow structures of fields. You can iterate through multiple rows of data in a voice application and present it to the caller. To do this, the Visual Composer voice kit provides a comprehensive set of functions to iterate and modify the table data. You retrieve data from the back-end systems and map it to the variables of the corresponding data type in the dataStore.

Note Note

You can map data from back-end systems to variables of single data type and not to variables of mixed data types.

For example, you cannot map data to a variable of data type Table that has a field of type Record.

End of the note.
Row Pointer

A row pointer is a cursor that treats a row as the current row. You can use this feature to refer to the fields in that row.

When you load data from the data service to a table in the dataStore, the row pointer points to the first row of the table. To iterate over data in the table add a Process Element to the voice model and use the set of actions provided in the Process Element.

The following table provides information on the actions that you can perform on a table:

Action

Description

Add row

Adds a row to the table indicated by the position (After Current, Before Current, After Last, Before First)

Delete row

Deletes data in the current row

Clear table

Clears all the data in the table

Find row

Finds a row in the table that matches the Expression. The row pointer stops the search at the first match.

Move to row

Allows you to move the row pointer to either first, last, next, previous, or row positions. If you select row as the Position, then the row field is enabled, which allows you to enter a row number (rows are numbered starting at 1).

Revert row

Reverts the value of the field in a row.

Set variable

Overwrites the value of a field in a row.

Shadow Variables of a Table

Every table contains a set of predefined read-only variables that reflect its status. These variables are referred to as shadow variables and are updated whenever a table operation takes place. The shadow variables can be used in expressions to help control the behavior of the dialog when working with tables.

The following list provides a brief description on each of the shadow variables:

  • _action returns the last attempted row pointer operation, such as first, last, next, previous, or row

  • _actionIgnored indicates whether the attempted operation was successful or not

  • _index contains the current row number

  • _isEmpty returns true if the current row is empty

  • _isFirst returns true if the row pointer points to the first row in the table

  • _isLast returns true if the row pointer points to the last row in the table

  • _isMiddle returns true if the row pointer points to the middle row in the table

  • _isSingle returns true if the table contains only one row in the table

  • _size contains the total number of rows of a table