How to use Value Lists in a Flow
  • Updated on 04 Apr 2019
  • 3 minutes to read
  • Print
  • Dark
    Light

How to use Value Lists in a Flow

  • Print
  • Dark
    Light

A Value List is a basic entity that contains an enumerated list of strings like those found in a drop down menu.  These can be defined statically or as a string list within a component.  To make a list that is universally accessible by all flows you can create a Value List
Example
The goal of this example is to:

  1. Create a simple value list representing task priorities.

  2. Create a flow to use the list.

  3. Execute the flow.

Navigate to the Decisions Studio portal. Expand the System > Designers folder and click on the Data Structures folder.
2018-06-29_115847.jpg

To create a new Value List , click All > Add > User Defined Types and select Value List from the pop-up menu.
2018-06-29_120102.jpg

In the Add Value List [Enum] window, set the Type Name as Priority Level
Next we have to add items to our Value List. Since we know what values we want our list to contain we can select the Bulk Add option. Select Done. Select Create Value List.
2018-06-29_120223.jpg

The Value List is now available for use.

Note
It is important to collect the Data Type Name for this list.  It will be used when the flow is created.  To find the data type full name, select the newly created value list entity and view the detailed information in the Properties Panel on the bottom right corner of the screen.

Navigate to a Designer Folder and click on the Create Flow button.
CREATE-ACTION-BAR7.jpg

In the resulting New Flow popup window, name the flow and click OK .
2018-06-29_120601.jpg

The first step is to get the Value List that was just created.  To do this, in the Flow Designer Quick Add 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.

2018-06-29_120748.jpg

Select the Get Enum Values By Name step and under Inputs > fullName define the Mapping Type as Constant . In the Value field, enter the Data Type Full Name that was collected earlier in the example.
2018-06-29_121003.jpg

For visual purposes, this example will display the different items in the Value List as popup notifications to the user. To do this will need to use a ForEach Step. In the Steps panel go to Flow Management and select a ForEach Step component to add it into the workspace.
2018-06-29_121125.jpg

In the Edit Step dialog of the ForEach Step, under Data > Type, select String from the drop down menu. 
In the Inputs section, click on the Mapping Type drop down menu and select the Select Value option.  Then click on the Pick button and in the resulting popup window, select GetEnumValuesByName_Output and click Pick .
2018-06-29_121300.jpg

Now, in the Toolbox Panel , go to Communication and select a Send Notification component and add it into the workspace.
2018-06-29_121743-1.jpg

Select the Send Notification step and in the Edit Step dialog select the Add New button in the Notify To > Notify User section.
In the resulting Pick Entity dialog, select the user to be notified and click the Pick button.
2018-06-29_121944-1.jpg

Next, configure the inputs to the Send Notification step. Under I nputs > Message , select the Text Merge.Plain from the drop down list.  Then click the Show Editor button for the Merged Text item. 
2018-06-29_123259.jpg

In the resulting Merge Text Editor popup window, hover over Item and click Add . Close the Editor.
2018-06-29_123442.jpg

Finally, in the Inputs section, under the Subject section, set the Mapping Type to constant and name the Value field “Enum Flow”.
2018-06-29_123616.jpg

Ensure all of the flow steps are properly connected and correct any validation errors that exist.
To verify the flow is properly configured, click on the Debug button at the top of the screen. 
2018-06-29_123842.jpg

When the debugger finishes, the execution path is highlighted and the notifications are displayed on the screen.

Was this article helpful?