Skip to main content

LookupTable component

Use the Lookup Table to create a dataset that is stored in memory for the time that a project is running. The Lookup Table provides a way for you to modify data by selecting or updating records in automations. You use the TableView component to present filtered data from the Lookup Table to the user.

Using the TableView Component

While using the TableView component, select and update records from the dataset for use in automations. The TableView component provides quick access to the most frequently used data in the solution, as well as making data sets updatable, for use within automations.

The TableView component does not store data but instead presents a view of its connected corresponding DataTable. Changes to the TableView affect the data table, and changes to the data affect all TableView components associated with it.

The TableView component contains methods that you can use to add new rows, send currently displayed data to a new table, and enumerate items. The following image shows the Table provider property being set to the Lookup Table in your project as the data set:

Screenshot showing a property grid of the TableView component

Manipulating data in a DataGrid

Along with the TableView component, you can continue manipulating data by placing a DataGrid on a Windows Form and directly interacting with it. Because the DataGrid functions like an Excel sheet, you can perform actions such as selecting either single or multiple cells and editing them. You can also set up your automations to respond to data using an event.

The following image shows setting up the DataGrid by setting the Data Source property to the Lookup Table in your project.

 

Screenshot showing a property grid of a DataGrid component

You can find the Lookup Table in the Data Handling > Tables section of the Toolbox. To use it in your project, drag the component to the automation surface to be automatically added to the Global project. You can also add a Lookup Table directly to the Global tab by dragging it from the Toolbox menu.   

The Lookup Table structure

The Lookup Table is a global component, which means once its structure is defined, the Lookup Table can be used and updated by any automation in the project. Before using a Lookup Table's properties, methods, or events, you must define the fields and key. For different table structures, use more than one Lookup Table component. 

To define a Lookup Table structure, go to the global section of the Toolbox and click the ellipsis (...) icon on the Fields property.

Screenshot showing configuration of the property grid using a collection property

 Use the LookupField Collection Editor to define table fields and their properties.

Property Description
AutoIncrement Select true if you want the system to automatically increment the key field's value each time a new record is added. 
FieldName Enter the name of the field.
Key Enter True if this field is the key field for the table. The system uses the key field to index the table. Only one key field can be present in the table. 
Type

Select the field type. Available data types:

Alias Data type
byte System.Byte
sbyte System.SByte
int System.Int32
uint System.UInt32
short System.Int16
ushort System.UInt16
long System.Int64
ulong System.UInt64
float System.Single
double System.Double
char System.Char
bool System.Boolean
object System.Object
string System.String
decimal System.Decimal
DateTime System.DateTime

 

For example, a banking company implemented an automated system that sends monthly reports to its customers: statements, fee reports, and monthly lending reports. The reporting project updates the customer data from the banking application every month by storing the address and contact details in a Lookup Table to process all reports to keep the records current.

The Lookup Table storing the customer's data is defined in the following example. 

A LookupField Collection Editor

Lookup Table in an automation

To use a Lookup Table in an automation, drag the Lookup Table from the automation's Palette and pick a property, method, or event. Use an AddRecord method to add a row of data to the table. In addition, a single column can be updated in the row using the UpdateField method. 
 

In the following image, click the + icons to see details about adding data to a Lookup Table.

Interaction with external applications

Pega Robot Studio™ allows you to import and export table data to a Lookup Table.

Use an ImportDelimitedFile method to import data from a text file to a Lookup Table. Specify a file path, delimiter, and mappingMethod parameters to correctly import the data. 

Input Parameter Description
delimiter Select the character that is used as the delimiter.  Choose from these options: Tab, Whitespace, Comma, QuestionMark, Caret (^), Pipe (|), or Other. When choosing Other, specify the delimiter character in the customDelimiter parameter.
mapping method Specify how the data is imported into the lookup table. Select UseRowHeader if the first line in the file determines the column names. Select UseColumnIndex to map the columns in the file data to the lookup table based on the column position. 

In the following example, using commas as a delimiter, a Lookup Table is filled with data from the text file.

Customer data file example
Screenshot showing automation blocks that allow to import file data to the lookup table.

You can also export data from a Lookup Table to Excel. Use a GetTable method to retrieve the entire Lookup Table as a DataTable, like in an example below. 

Screenshot showing an automation that imports data from the lookyp table to the excel.

For more information about an Excel Connector, see Excel Connector.  

Check your knowledge with the following interaction.


This Topic is available in the following Modules:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice