Lookup List OverviewLast 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).
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.
In the resulting window we Name the Flow and click Create to proceed to the Flow Designer.
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.
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.
Next, on the Done outcome from the Get all from dbo.Customers step we add Create Data step from Favorite Steps category.
Then, we Name our Data Definition and pick DataPair Type.
We need to check Is List checkbox for this Data Definition to be a List. Click Ok when finished.
Our Data is defined and we can click Add to continue.
Next, we need to populate or Defined Data. We add ForEach step from the All Steps [Catalog] > Flow Management category.
In the resulting window we pick Customers_Result collection for the ForEach step and click Add.
On the Next outcome from the ForEach step we add Add Item To List step from the All Steps [Catalog] > List category.
Then, with Add Item To List step selected on the workspace we configure its Data Type to be DataPair.
Next, we click Show Mapping Editor for the Add Item To List step.
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.
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.
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.
Then, we select End Step on the workspace and Select Value of our ListData as ListData input.
This completes our Lookup List Flow. We can save the flow and close Flow Designer.
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.
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.
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).
Next, we are going to add one of our Customers as an Output from our Flow.
Then, we click Test Flow on the Top Panel of the Flow Designer to run our Flow in the Debugger.
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.
Next, we close Flow Designer. Back in the Designer Folder we click Create Rule > Create Rule on the Folder Actions Panel.
Then, we Name our Rule and click Create to proceed to the Rule Designer.
In the Rule Designer we Add New Rule Input Data.
We define a simple String and click Ok.
Next, we click Add New Rule Step.
Pick Rule Input that we defined and click Next.
As verb for our Rule we use Is and click Next.
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.
We click Done to complete our Rule Step definition.
Our Rule is complete and we click Test Rule on top Panel of Rule Designer.
In the Rule Debugger we define the value of the Rule Input with an id of our picked Customer.
The Rule evaluates as True.