- 26 Oct 2021
- 3 Minutes to read
- Print
- DarkLight
Lookup List Flows
- Updated on 26 Oct 2021
- 3 Minutes to read
- Print
- DarkLight
Overview
Lookup Lists are used to search for a specific set of data (typically within a Database Table) that can be accessed and used within a Flow or Rule. The Lookup List feature allows Designers to create specific System Constants and obtain the value of an Object via a defined key.
This value can be output as either a Data Pair, a DynamicDataRow, or an Object, depending on the type of Lookup List Flow they originate from.
The following examples detail how to use the different Lookup List Flows to pull information from the dbo.entity_account table.
Example A: Data Pair
- Navigate to System > Designers > Lookup Lists and Constants.
- Locate the Add Lookup List Flow action button and then choose Lookup List Flow (Data Pair) to create a Lookup List.
- From the Flow Designer, from the Favorite Steps category of the Steps tab, attach a Fetch Entities step to the Start step. Then attach the No Results path to the End step.
- Navigate to the Properties tab of the Fetch Entities step; under Entity Fetch Definition > Type Name, search for and PICK Account.
- Under the Data > List category of the Steps tab, attach a List Mapping Step to the Results path of the Fetch Entities step, as well as the End step.
- From the Properties of the List Mapping Step, under Data > Output Type, search for and select DataPair, then Select From Flow map EntityResults to Inputs > INPUTS.
- While still in the Properties for the List Mapping Step, select Show Item Mapping Editor.
- From the resulting Mapping Editor, expand the Inputs column on the right via the grey arrow, then set ITEM's mapping to Build Data.
- In the column on the left, expand _INPUT. Then, from the resulting elements in the dropdown, map AccountID to Name, and EmailAddress to OutputValue by dragging a path out to each respective value. Then click OK to save and exit the window.Additional InformationEstablishing this mapping will map the passed through account EmailAddresses and AccountIDs together as individual DataPairs.
Back in the Flow Designer, select the End step to navigate to its Properties; under Inputs, map OUTPUTS to List Data.
Save the Flow, then run the Debugger via the Debug link.
From the Debugger verify that the DataPairs were Output as expected by selecting the End step, then Execution 1 > View Input/Output Data. Then exit the Debugger as well as the Flow Designer.
- Navigate to a different Flow in the Decisions Studio and expand the Data Explorer. Verify that the Lookup List is available to use.
Example B: Data Row
- From System > Designers > Lookup Lists And Constants, select ADD LOOKUP LIST FLOW > Lookup List Flow (Data Row).
- Provide a Name, then select CREATE.
- From the Flow Designer, attach a Get all from dbo.entity_account step, from Steps > Integration > Database > [DatabaseName] > dbo.Entity_Account (Table) to the Start step.
- From the Properties tab of the Get all step, under Output Settings > Return Data Option, select Data Rows. Then under Inputs > Limit Count, Constant map the desired Limit count. Additional Information on Limit CountThe Limit count input is used to limit the number of data returns.
Connect both the Done and Failed paths to the End step. Then select the End step to navigate to its Properties tab. Select From Flow map entity_account_Result.Last to Inputs > Output Row.
Save the Flow, then if desired, Close.
From the Flow Designer, select the Debug link on the top Action bar. Then, click FULL.
After the Flow runs, select End step > Execution 1 > View Output Data to view the Output DynamicDataRow.
Debug ResultsThe resulting OutputRow for this example reflects the 10th row within the Accounts Database.
Example C: Object
- From the Decisions Studio, navigate to System > Designers > Lookup Lists And Constants, then select ADD LOOKUP LIST FLOW > Lookup List Flow (Object).
- From the Flow Designer, attach a Get all from dbo.entity_account step, from Toolbox > Integration > Database > [DatabaseName] > dbo.Entity_Account (Table) to the Start step.
- From the Properties tab of the Get all step, search for and select Account from the Output Type dropdown. Then Constant map the desired Limit count.
- Connect the Done and Failed paths to the End step. Then from the End step's Properties, Select From Flow map entity_account_Result to Output Object.
- Save the Flow, then if desired close via X.
- From the Flow Designer, select the Debug link from the top Action bar. Then click START DEBUGGING.
- After the Flow runs, select End step > Execution 1 > View Output Data to verify the Output results. Debug ResultsAs the Limit count on the Get all step was set to 4, the resulting Output will reflect the first four Account Objects from the Account Database Table.