Lookup List Flows
  • 13 Jan 2023
  • 3 Minutes to read
  • Dark
    Light

Lookup List Flows

  • Dark
    Light

Article Summary

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 key in the example below will always correspond with the value, which can be a value of any Data Type, such as the Composite type "Accounts" that is included in Decisions by default.

The following examples detail how to use the different Lookup List Flows to pull information from the dbo.entity_account table; this table is only available after configuring the connection


Data Pair 

The following example demonstrates how to create a Lookup List Flow (Data Pair) that will fetch all accounts, map them to a List Mapping step and Output a Lookup List (Data Pair).
  1. Navigate to System > Designers > Lookup Lists and Constants.
  2. Select ADD LOOKUP LIST FLOW > Lookup List Flow (Data Pair) from the top Action bar; Name the Flow, then click CREATE
  3. Attach a Fetch Entities step from the DATABASE ENTITY category of the Toolbox tab on the left, to the Start step.
  4. Select the Fetch Entities step to navigate to its Properties tab.
    1. Under ENTITY FETCH DEFINITION, search for and PICK Account under Type Name
  5. Attach a List Mapping Step from Toolbox > DATA > LIST, to the Results path of the Fetch Entities step.
    1. Connect the No Results path to the End step. 
  6. Navigate to the List Mapping Step's Properties tab.
    1. Map EntityResults to INPUTS.
    2. In the Output Type dropdown menu, search for and PICK, DataPair.
    3. Click Show Item Mapping Editor.
  7. Set the mapping for ITEM to Build Data
    1. Expand _INPUT and connect EmailAddress to Name and AccountID to OutputValue. Then, click OK.
  8. Connect the Done path to End step. 
  9. Navigate to the End step's Properties tab and map OUTPUTS to List Data,
  10. Save the Flow, then close with if desired.
  11. From the Flow Designer select the Debug link from the top Action bar.
  12. Click START DEBUGGING
  13. After the Flow runs, view the Input data for the End step. 
    The End step's inputs will display a DataPair for each AccountID and its corresponding Email. 



Data Row 

The following example demonstrates how to create a Lookup List Flow (Data Row) that will output a DynamicDataRow from a row in the Account Database Table. 
  1. From System > Designers > Lookup Lists And Constants, select ADD LOOKUP LIST FLOW > Lookup List Flow (Data Row)
  2. Provide a Name, then select CREATE. 
  3. From the Flow Designer, attach a Get all from dbo.entity_account step, from Toolbox > INTEGRATION > DATABASE > [DATABASE NAME] > DBO.ENTITY_ACCOUNT ( TABLE) to the Start step. These steps are only available after Integrating with a Database Table.
  4. 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 Count
    The Limit count input is used to limit the number of data returns. 


  5. 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

  6. Save the Flow, then if desired close via X

  7. From the Flow Designer, select the Debug link on the top Action bar. Then, click START DEBUGGING. 

  8. After the Flow runs, select End step > Execution 1 > View Output Data to view the Output DynamicDataRow. 

    Debug Results 
    The resulting OutputRow for this example reflects the 10th row within the Accounts Database.  



Object 

The following example demonstrates using a Lookup List Flow (Object) to output an Account Object from the dbo.entity_account Table. 
  1. From the Decisions Studio, navigate to System > Designers > Lookup Lists And Constants, then select ADD LOOKUP LIST FLOW > Lookup List Flow (Object)
  2. From the Flow Designer, attach a Get all from dbo.entity_account step, from Toolbox > Integration > Database > [DATABASE NAME] > DBO.Entity_Account (Table), to the Start step.
  3. 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
  4. 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.  
  5. Save the Flow, then if desired, Close.
  6. From the Flow Designer, select the Debug link from the top Action bar. Then click FULL. 
  7. After the Flow runs, select End step > Execution 1 > View Output Data to verify the Output results. 
    Debug Results 
    As 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. 


Was this article helpful?