Extract
Returns an object with the given list of members. It is equivalent to having a struct inside a return.
Syntax
extract
[column1]
[value1]
[column2]
[value2]
…
- column1-N
- The names of the struct members. These names are used to generate column names during an extraction.
- value1-N
- The values of the struct members.
Remarks
Extract actions can be nested to produce more than one related output tables. These tables can be quickly seen as a single table by right-clicking the table set and selecting Join Tables or Create Query. Supposing Select.Review selects many reviews per product, the following example would extract product information into two related tables, where the main table contains one row per product, and the child table contains one row per review:
extract
title
Select.Title
price
Select.Price
reviews
Select.Review
extract
date
Select.ReviewDate
rating
Select.ReviewRating
comment
Select.ReviewComment
Note that between the reviews column name and the nested extract action, any other actions could be used. For instance, a Browser.Navigate action could be added below Select.Review if the elements selected by Select.Review were links to the actual review.
When an extract action runs, columns are evaluated sequentially from first to last, but every column is evaluated on the same browser state. This implies that if a column changes the state of the browser in any way, such as by clicking a button or navigating away, the browser will return to the original state before evaluating the next column, if any. Because of this, it's best to put columns that change the state of the browser last.