Collection values overview

A collection is a container that can hold items of one type. When you create a variable of any type, you can make a collection of that type. You can also create collections of custom data type variables. You will most often use collections:

  • At design time to create lists of values to collect, typically for an agent.
  • At run time, to retrieve ordered sets of values, for example, transaction to read back to a caller.

Notes:
  • The maximum number of items allowed in a collection is 2,000.
  • A collection value itself cannot be NOT_SET. It contains zero or more values of one type whose value can be NOT_SET. A value in a collection is referred to as an item.

Variables in a collection

Flow authors can create variables whose value is a collection. The value of the variable is contained within the collection. In a collection, a variable also has a name, description, and facets such as decimal places on a decimal variable. In collections, the variable’s value is a collection instead of a single value. The Array(Collection) index begins at zero.

Let’s look at the following example expression to understand why a collection doesn’t necessarily equate to a variable: 

MakeList(1,2,3) 

The result of the MakeList expression above is an integer collection that includes three items. A flow author could assign the values to an integer collection variable as follows:

MakeList(1,2,3)[2]

The above example returns the third item in the collection–the value 3.