Defining Collections
A Collection is a type of User or Session Variable that contains a set of items. It is always one of the following types:
Simple Collection: Contains a list of values. Each value is of the same primitive data type (number, date, etc.)
Object Collection: Contains a list of items (objects) that are each made up of a set of fields. For example, a customer's Object Collection might be made up of the fields First Name, Last Name, Account ID, Phone Number, etc. Objects that are available for use in a Collection are defined in the X-Console using Custom Types, Enums, Rules, or Intents.
Once you define a Collection, you can use it to display sets of information to customers, allocate items from the Collection into other variables, and so on. Collections are almost always used to receive values from an outside service via an Integration Point.
For more information about how to use Collections, refer to Collection Use Case Examples.
Note
This article shows you how to create a Collection as a User Variable (available for use in the current Flow). To create a Collection as a Session Variable (available for all Flows in the account), see Adding Session Variables.
Creating a Collection for a Single Flow
Open the Flow that will use the Collection.
From the Solution Explorer or Variables list, click the Add
icon. The Variable Editor opens.
In the Variable Name field, enter a unique name for your Collection variable.
From the Variable Type drop-down list, select Collection.
From the Of drop-down list, select the relevant option:
For a Simple Collection, select the required primitive type (text, number, etc.).
For an Object Collection, select the required Custom Type, Enum, Rule, or Intent (listed after primitive types in the dropdown list).
Select Security options as needed. (Refer to Creating User Variables for more information.)
Define a display Format as needed. (Refer to Designing Variable Display Formats for more information.)
Click Save Variable when you have finished. The Variable Editor closes and the Collection is added to the Variables tab in the Solution Explorer.
Setting Default Values for a Collection
Optionally, you can provide one or more default values for the Collection variables in the current Flow. This can be useful when Collection values need to be consistent or in close conformance with an Integration Point. Default values can be provided for Collections of both Simple and Object Collection types.
In the Default section, click the Add.
icon and provide one or more values, as shown below:
To add additional values, click the Add.
icon again.
You can enter static values as well as variables as defaults. To add a variable, enter '@' to view a list of available variables.
When entering or editing the default values, you can delete an entry by clicking its Trash
icon or change the order of entries by dragging its Position
icon, as needed.
When finished, click Update Variable . The Variable Editor closes and the Collection is added to the Variables tab in the Solution Explorer.