Selecting data

In order to extract the data, it is necessary to first define the data to be extracted, by selecting it. How this is done depends on the data source type. The following paragraphs explain how to create and manipulate a data selection for each different type of data.

Data selections are used to extract promotional data (Extracting data), transactional data (Extracting transactional data) and to apply a condition to an extraction (Condition step). They can also be used to control the workflow through conditions and loops.

Right-clicking on a data selection displays a contextual menu with the actions that can be performed with that selection or the steps that can be added with it. That menu also displays the keyboard shortcuts.

Text or PDF file

To select data in a Text or PDF file, click on a starting point, keep the mouse button down, drag to the end of the data that needs to be selected and release the mouse button. The data selection can contain multiple lines.

To resize a data selection, click and hold one of the resize handles on the borders or corners, move them to the new size and release the mouse button.

To move the data selection, click and hold anywhere on the data selection, move it to its new desired location and release the mouse button.

Note: In a Text or PDF file, when you move the selection rectangle directly after extracting data, you can use it to select data for the next extraction.
However, moving the selection rectangle that appears after clicking on a field in the Data Model actually changes which data is extracted into that field.

CSV/XLS/XLSX file or database recordset

Tabular data is displayed in the Data Viewer in a table where multiple fields appear for each line and row in the original data.

To select data, click on a field, keep the mouse button down, drag to the last field that you want to select and release the mouse button. You cannot select multiple lines with tabular data.
Alternatively you can select fields just like files in the Windows Explorer: keep the Ctrl button pressed down while clicking on fields to select or deselect them, or keep the Shift button pressed down to select consecutive fields.

XML file

XML data is displayed as a tree view inside the Data Viewer.

In this tree view you can select nodes just like files in the Windows Explorer: keep the Ctrl key pressed down while clicking on nodes to select or deselect them, or keep the Shift key pressed down to select consecutive nodes.
You can select multiple fields even if those fields are in different nodes.

To get a better overview you can collapse any XML level.

XMLPath

The Goto step is rarely used in XML extraction workflows. The DataMapper moves through the file using Xpath, a standard query language to identify and navigate nodes in an XML document.

JSON file

JSON data is displayed as a tree view inside the Data Viewer. Arrays and objects are enclosed in square or curly brackets, respectively: [ ] or { }.

In this tree view you can select elements just like files in the Windows Explorer. Keep the Ctrl key pressed down while clicking on key-value pairs or brackets to select multiple elements, or keep the Shift key pressed down to select consecutive elements.
You can select multiple key-value pairs, arrays and objects even if those are in different elements.

To get a better overview you can collapse any JSON level.

JsonPath

The DataMapper moves through JSON files using JsonPath, a path-like syntax to identify and navigate elements in a JSON document. For an overview of the JsonPath syntax, see https://github.com/json-path/jsonpath. One example of this is given in a How-to: XML/JSON loops.

In the DataMapper the JsonPath can be absolute (start with $ which is the root) or relative to the current position (start with . which is the current element).

JsonPath can be used in a Repeat step, Extract step and Condition step, often eliminating the need for a Goto step.

A JsonPath can be relative or absolute. Note, however, that with a relative JsonPath going up to a parent element is not possible.

Tip: The full JsonPath to an element is displayed at the bottom left of the window when you select it. To copy the path, right-click it and select Copy.

Note: If a key in a JSON file has a name that looks like a function (e.g. "TLIST(A1)"), then the Extract step has to use a JsonPath with bracket notation instead of the default dot notation. For information about the bracket notation see https://goessner.net/articles/JsonPath/.