Skip to main content

Extract Table Data

Use the Extract Table Data interrogation method to interrogate tables and extract data from table columns. To extract the data from a table, the system executes a query you define and returns the data for you to use in your automation. You can also set an optional pagination control to automatically extract data from all pages of a table.

The Interrogation Form with the interrogation method dropdown list expanded and Extract Table Data option highlighted.

For example, your organization wishes to review the account information of all customers whose accounts are older than 10 years. The customer information is in a table with many hundreds of entries spread across many pages. You use the Extract Table Data interrogation method to select the specific columns you require, then select the pagination control that will move to the next page in the table. When you execute your query, the data returned includes all rows that match your query from all pages in the table. You save the data to a spreadsheet to pass along for review.

Interrogation

To interrogate a table in an HTML page using the Extract Table Data method, select Extract Table Data from the interrogation form. Drag the Capture icon to one item in any row, except the header row, in the column your required column.

The system creates the necessary parent controls for the extracted column. The parent table appears as a control called ExtractedTable and the interrogated column appears as ExtractedColumn. Rename the controls to a friendly name for the controls. Repeat the steps for all columns required for your use case. The ExtractTable control is created only once when you first interrogate a column in the table.

In the image below, the Customers table of a website was interrogated using the Extract Table Data method. The two required columns for this automation are the customer’s account number and the customer’s name. The extracted table was renamed to Customers. The eyeglass icon next to the table name indicates that the control can be queried.

The object hierarchy for a table interrogated using the Extract Table Data interrogation method showing the magnifying glass icon next to the control..

For more information, see Extracting matched data from HTML tables.

Pagination

When working with an interrogated table, you can use the PaginationControl to automatically search through all pages of a multi-page table. The PaginationControl can be an interrogated control, such as a NextPage button the website or an automation you’ve designed specifically to iterate through the pages of the table.

Select the PaginationControl from the properties grid of the extract table control. Select your desired control or automation from the application hierarchy view as seen in the image below.

The PaginationControl property in the property grid of an extract table control.

As a best practice, do not use the PaginationControl to extract data from tables that progressively load on scroll, a pattern that is commonly known as Infinite Scroll or Load More, because this results in duplicated data in the extracted table.

Working with data

Access the query editor by right-clicking the extracted table control and selecting Actions > View query or by clicking View query in the Actions section of the properties grid. The system displays the Query editor dialog box. Click the + icons in the image below to learn more about the Query editor dialog box.

After you have interrogated the necessary controls and configured the required queries in the Query editor, you can work with the data in an automation by using the ExtractToDataTable or ExtractToJson methods. Drag the extract table control to the automation designer surface, then select the desired method from the Select action dialog box. 

The Select action dialog box for an extracted table control showing the two Extract to ... methods available.

Check your knowledge with the following interaction. 


This Topic is available in the following Module:

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