Allocators are used to automatically assign a known value to a variable, or to assign the value of one variable to another variable.
Allocators are commonly used to manipulate real time data and streamline the Flow. For example, allocators let you:
- Make navigation easier for the user. If the same variable is used multiple times in a Flow, once a value is allocated to it, that value is automatically used in all instances where the value is required (e.g., a customer phone number). The customer does not have to re-enter it. (If the value of the variable is updated during the Flow, the latest value is allocated.)
- Make a global change to a variable. When you change the allocation source value, the new value is applied to all instances of the target variable.
- Hold data to be used by other Flow elements. For example, the answer to an input question can be allocated to a variable. That variable is then used by a Decision step that determines the direction of the flow according to the value of the variable.
- Transfer variables between two Collections. Easily move variables from a specified source Collection to a target Collection, replace or clear a specific variable.
An allocator must have a unique name, a target variable, and a source value or variable that will be allocated to the target variable. Allocators are defined and maintained in the Allocator Editor.
The following table describes the Allocator Editor settings:
|Allocator Name||Enter a unique name for the allocator element. Allocators are only visible in the web designer and are transparent to end-users.|
|Target Variable (Left Side)||Determine the variable that is affected by the allocation. Select an existing variable from the popup list of all variables, or create a new variable for this purpose. Any variable can be used, including a Dynamic Variable member path, an item from a Collection, or a field from a Custom Type.|
|Operation||Determine the behavior of the allocated value:
|Source Value (Right Side)||Provide a hard coded value to allocate to the target variable, or select an existing element that determines the value allocated to the target variable. Any variable can be used, including a Dynamic Variable member path, an item from a Collection, or a field from a Custom Type.
Make sure that the value you define here is of the same type (text, number, etc.) as the target value. The variable or value you enter will be used for all instances of the target variable in this Flow.
When assigning value(s) to a target Dynamic Variable (left side), provide valid JSON code or a static value for the target variable member specified. The Allocator does not perform a type check when a Dynamic Variable is assigned. Invalid code or non-matching types will not return any response.
Use one of the following options:
|The Add icon for creating additional allocations. When you create several allocations, you can reorder them using drag-and-drop. Allocations are performed in the order that is specified from top to bottom.|
To create an Allocator:
- From the Flow map, hover over the relevant page and select Navigation Logic>Allocator. The Allocator Editor opens.
- In the Allocation Name field, enter a unique name for the allocator.
- Click in the left side (target) variable field, and either:
- Select the variable from the list of all inputs and variables, or
- Click to add a new variable.
(For instructions, refer to Creating User Variables.)
- Select the desired allocation operation (Refer to the table above for details.)
- From the right side (source) variable field, determine the value to allocate:
- Enter @ and then select or add a variable from the Variable list, or
- Enter a set value
- Click to add more allocations, as required.
- When you are finished, click Create Allocator.
The allocator appears on the Flow map, and is connected to the page from which it was created.