Lookup List Overview

Last Updated: 07/19/2016 Introduced in Verision: 3.5

This tutorial demonstrates how to create and use Lookup Lists in Decisions. Lookup List is a feature that was implemented in Decisions 3.5 and newer. This feature allows to create a specific System Constants where designer is able to get the value of an Object by defined key. Each entity in the Lookup List is represented as a key – value data pair. In this data pair key is a String and value can be any Type (for example it could be a complex Account type).

Example.

In this example we are going to create a Lookup List using external database integration. Then, we are going to demonstrate how this Lookup List data can be accessed from the Flow or Rule Designer.

First, we navigate to the System > Designers > Lookup Lists And Constants Folder in the Portal and click Add Lookup List Flow on Folder Actions Panel.

addLookupListFlow

In the resulting window we Name the Flow and click Create to proceed to the Flow Designer.

nameFlow

First, we are going to get data that we will need for our Lookup List. As mentioned previously, we are going to use external database integration for the Lookup List. From the Integrations > My Integrations > Database > Northwind (Database) > dbo.Customers (Table) category we add Get all from dbo.Customers step.

addGetAll

Then, we connect Failed outcome from the Get all from dbo.Customers step to the End Step in our Flow, and Ignore Limit Count Input to this Get All step.

ignoreLimitCount

Next, on the Done outcome from the Get all from dbo.Customers step we add Create Data step from Favorite Steps category.

createData

Then, we Name our Data Definition and pick DataPair Type.

defineData

We need to check Is List checkbox for this Data Definition to be a List. Click Ok when finished.

dataDefined

Our Data is defined and we can click Add to continue.

add

Next, we need to populate or Defined Data. We add ForEach step from the All Steps [Catalog] > Flow Management category.

addForEach

In the resulting window we pick Customers_Result collection for the ForEach step and click Add.

selectCollectionForEach

On the Next outcome from the ForEach step we add Add Item To List step from the All Steps [Catalog] > List category.

addItemToList

Then, with Add Item To List step selected on the workspace we configure its Data Type to be DataPair.

defineListType

Next, we click Show Mapping Editor for the Add Item To List step.

showMappingEditorForList

In the Mapping Editor we use our List Data as an Original List Input and on the Output we Change Value of the List Data. For the New Item Input we use Build Data option to build our Data Pair.

buildDataForItem

Then, we use current Customer Name as Name input (our key) and Customer ID as an Output Value (we could use the whole Customer Object as an output value). Using this design we will build a Lookup List where we will be able to use Customer ID and get it by Customer Name as System Constant. When finished, we can close Mapping Editor.

mappingCompleted

Next, back in the Flow Designer we connect Done outcome from the Add Item To List step back to ForEach step and Done outcome from ForEach step to the End Step in our Flow.

connectStepsInFlow

Then, we select End Step on the workspace and Select Value of our ListData as ListData input.

mappingForEndStep

This completes our Lookup List Flow. We can save the flow and close Flow Designer.

flowCompleted

Next, we navigate to the Designer Folder, and from the Folder Actions Panel click Create Flow. In the resulting window we Name our Flow and click Create to proceed to the Flow Designer.

nameFlowMain

In the Flow Designer we simply connect Start Step to the End Step. With End Step selected on the workspace we click View Flow Data to check what data is available for us.

viewFlowData

We should see that our Lookup List that we created in this tutorial is available for us just like System Constants. If we expand this list, we will see all our Customers listed by Customer Name (key).

lookupListAsSysConst

Next, we are going to add one of our Customers as an Output from our Flow.

addFlowOutput

Then, we click Test Flow on the Top Panel of the Flow Designer to run our Flow in the Debugger.

testFlow

When our Flow is executed we should see that our Flow outputs our Customer by Customer Name with Customer ID value. Close Flow Debugger when finished.

idOutput

Next, we close Flow Designer. Back in the Designer Folder we click Create Rule > Create Rule on the Folder Actions Panel.

createRule

Then, we Name our Rule and click Create to proceed to the Rule Designer.

nameRule

In the Rule Designer we Add New Rule Input Data.

addInput

We define a simple String and click Ok.

defineInput

Next, we click Add New Rule Step.

addNewRuleStep

Pick Rule Input that we defined and click Next.

pickIdStr

As verb for our Rule we use Is and click Next.

pickVerb

Then, we use Select Value Mapping type. Using Path picker we should see our Lookup List as available data. We can expand it and pick one of our Customers listed by Customer Name.

pickCustomer

We click Done to complete our Rule Step definition.

closePicker

Our Rule is complete and we click Test Rule on top Panel of Rule Designer.

testRule

In the Rule Debugger we define the value of the Rule Input with an id of our picked Customer.

runRule

The Rule evaluates as True.

success

Additional Resources