How to use Value Lists in a FlowLast Updated: 07/29/2016 Introduced in Verision: 2.0
A Value List is a basic entity that contains an enumerated list of strings, similar to those found in a drop down menu. These can be defined statically or they may be defined as a string list within a component. To make a list that is universally accessible by all flows, a quick and easy way is to create a Value List.
The goal of this example is to:
- Create a simple value list representing task priorities.
- Create a flow to use the list.
- Execute the flow.
To begin, navigate to the home page in the Decisions portal.
Expand the System > Designers folder and click on the Data Structures folder.
To create a new Value List, click on the Add button and select Value List from the pop-up menu.
In the resulting Add Value List pop-up window, set the Type Name as “Priority Level”.
Next, click the Add button and in the resulting Add Values pop-up window. Set the Value field to “Low”, and click Ok. Repeat this process until all of the desired values have been added and named.
The order of the Value List items can be changed by clicking on the specific item then clicking on the Move Up or Move Down buttons. Click Ok to close the Add Value List pop-up window.
Notice, the newly created Value List is now available for use.
Note: It is important to collect the Data Type Full Name for this list. It will be used when we create our flow. To find the data type full name, select the newly-created value list entity and view the detailed information in the Data Panel.
Now, navigate to a Designer Folder and click on the Create Flow button.
In the resulting New Flow pop-up window, name the flow and click Ok.
The first step is to get the Value List that was just created. To do this, in the Flow Designer start-up window expand the Integrations > All Integrations > Internal Services > Data Structure Services categories and select Get Enum Values By Name component. Click Add to add it to the workspace.
In the Properties Panel, under the Inputs section, in the fullName section define the Mapping Type by selecting Constant. In the Value field, enter the Data Type Full Name that was collected earlier in the example.
For visual purposes, this example will display the different items in the Value List as pop-up notifications to the user. To do this, in the Toolbox Panel, expand the Flow Management category and drag a ForEach Step component into the workspace.
In the Properties Panel of the For Each Step, in the Collection section click the Type Selection button and select String from the resulting Select Entity pop-up window. Then click Ok.
Next, in the Inputs section, click on the Mapping Type drop down menu and select the Select Value option. Then, click on the Path selector button ad in the resulting pop-up window, select GetEnumValuesByName1_Output and click Ok.
Now, in the Toolbox Panel, expand the Communication category and drag a Send Notification component into the workspace.
In the Properties Panel for the Send Notification step, select the Add button in the NotifyUser section of the Notify To section.
In the resulting Select Account pop-up window, select the user to be notified and click the Ok button.
Next, configure the inputs to the Send Notification step. In the inputs section, under the Message section, select the Mapping Type from the drop down menu. Then click the Show Editor button for the Merged Text item.
In the resulting Merge Text Editor pop-up window, select the Getenumvaluesbyname1 Output and click Ok.
Finally, in the Inputs section, under the Subject section, set the Mapping Type to constant and name the Value field “Enum Flow”.
Ensure all of the flow steps are properly connected and there are no validation errors present.
To verify the flow is properly configured, click on the Debug Flow option at the top of the screen.
Note that in Decisions version 3.5 and above, you will need to click Test Flow rather than Debug Flow.
When the debugger finishes, the execution path is highlighted and the notifications are displayed on the screen of the account chosen.