Lookup List Flows
  • 13 Mar 2024
  • 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 users to create specific System Constants and obtain the value of an object using 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.


Data Pair 

The following example will demonstrate how to create a Lookup List Flow that will fetch all accounts, map them to a List Mapping step and output the Lookup List.

  1. Navigate to System > Designers > Lookup Lists and Constants. Click ADD LOOKUP LIST FLOW and select Lookup List Flow (Data Pair) from the top action bar; name the Flow, then click CREATE.
  2. Attach a Fetch Entities step from the DATABASE ENTITY category of the Toolbox panel to the Done path of the Start step. On the Properties panel, enter "account" in the Type Name dropdown box and select Account.
  3. Attach a List Mapping Step from the DATA > LIST category to the Results path of the Fetch Entities step. Connect the No Results path to the End step.
  4. On the Properties panel, map EntityResults to the INPUTS field. In the Output Type dropdown menu, search for and select DataPair. Click Show Item Mapping Editor.
  5. Set the mapping for ITEM to Build Data. Expand _INPUT and connect EmailAddress to Name and AccountID to OutputValue. Click OK.
  6. Connect the Done path to the End step. On the Properties panel, map OUTPUTS to the List Data field. Click Save to save the changes to the Flow.
  7. Click Debug from the top action bar. Click START DEBUGGING. 
  8. 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 will demonstrate how to create a Lookup List Flow (Data Row) that will output a DynamicDataRow from a row in the Account Database Table. This example integrates with a Database Table.

  1. In Designer Studio navigate to System > Designers > Lookup Lists And Constants. Click ADD LOOKUP LIST FLOW and select Lookup List Flow (Data Row). Provide a Name and click CREATE.

  2. Attach a Get all from dbo.entity_account step to the Start step by navigating in the Toolbox panel to INTEGRATION > DATABASE > LOCAL CONNECTION > DBO.ENTITY_ACCOUNT ( TABLE). These steps are only available after Integrating with a Database Table.
  3. From the Properties panel, under the OUTPUT SETTINGS category, select Data Rows for the Return Data Option field. Select Constant map for the Limit Count field and enter "10".  
    The Limit count input is used to limit the number of data returns. 

  4. 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.
  5. Click Save to save the Flow.  
  6. Click Debug. Click START DEBUGGING.  
  7. After the debugger runs, select the End step > Execution 1 > View Output Data to view the Output DynamicDataRow. 
    The resulting OutputRow for this example reflects the 10th row within the Accounts Database.  



Object 

The following example will demonstrate how to use the 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. Click ADD LOOKUP LIST FLOW and select Lookup List Flow (Object). Name the Flow and click CREATE.
     
  2. Attach a Get all from dbo.entity_account step from the Toolbox panel by navigating to INTEGRATION > DATABASE > LOCAL CONNECTION > DBO.Entity_Account (Table) to the Start step.
  3. From the Properties panel, enter "account" in the Output Type field and select Account. Enter "4" in the Limit count field.

     
  4. Connect the Done and Failed paths to the End step. Select the End step and select the Select From Flow mapping for Output Object. Select entity_account_Result and click DONE.
       
  5. Click Save to save the Flow. 
  6. Click Debug. Click START DEBUGGING.  
  7. After the debugger runs, select End step > Execution 1 > View Output Data to verify the Output 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. 




    For further information on Flows, visit the Decisions Forum.

Was this article helpful?