- 13 Mar 2024
- 3 Minutes to read
- Print
- DarkLight
Lookup List Flows
- Updated on 13 Mar 2024
- 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 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.
What changed from V8 to V9?
Version 8 | Version 9 |
---|---|
Lookup Lists were configured at the System level and were visible across the platform. | Lookup Lists are now Project-level and are visible only within the Project. |
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.
- Navigate to Projects > Desired Project > Settings > Configuration > Variables > Lookup Lists. Click ADD LOOKUP LIST FLOW and select Lookup List Flow (Data Pair) from the top action bar; name the Flow, then click CREATE.
- 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.
- 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.
- 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.
- Set the mapping for ITEM to Build Data. Expand _INPUT and connect EmailAddress to Name and AccountID to OutputValue. Click OK.
- 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.
- Click Debug from the top action bar. Click START DEBUGGING.
- 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.
- In the platform, navigate to Projects > Desired Project > Settings > Configuration > Variables > Lookup Lists. Click ADD LOOKUP LIST FLOW and select Lookup List Flow (Data Row). Provide a Name and click CREATE.
- Attach a Get all from dbo.abstract_defined_case step to the Start step by navigating in the Toolbox panel to INTEGRATION > DATABASE > LOCAL CONNECTION > DBO.ABSTRACT_DEFINED. These steps are only available after Integrating with a Database Table.
- 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.
- 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 abstract_defined_case_Result.Last to INPUTS > Output Row.
- Click Save to save the Flow.
- Click Debug. Click START DEBUGGING.
- 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.
- From the Decisions Studio, navigate to Projects > Desired Project > Settings > Configuration > Variables > Lookup Lists. Click ADD LOOKUP LIST FLOW and select Lookup List Flow (Object). Name the Flow and click CREATE.
- Attach a Get all from dbo.abstract_defined_case step from the Toolbox panel by navigating to INTEGRATION > DATABASE > LOCAL CONNECTION > dbo.abstract_defined_case to the Start step.
- From the Properties panel, enter "account" in the Output Type field and select Account. Enter "4" in the Limit count field.
- 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 abstract_defined_case_Result and click DONE.
- Click Save to save the Flow.
- Click Debug. Click START DEBUGGING.
- 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.