Setting up detail tables with CSV
Detail tables are created when an Extract step is added within a Repeat step. The Repeat step goes through a number of lines or nodes. An Extract step within that loop extracts data from each line or node.
How exactly this loop is constructed depends on the type of source data.
This topic explains how to set up detail tables when extracting data from a CSV file or database.
Tip: To break out of a loop and immediately jump to the next task following the current loop, use an Action task and set its action to Break out of repeat loop.
How to extract transactional data that is not structured uniformly is explained in another topic: Extracting data with an Action step script.
The topic: Extracting data of variable length explains a few ways to extract data from a variable number of lines into one data field.
For more information about detail tables, multiple detail tables and nested detail tables, see Detail tables.
Creating the loop
In CSV or database data, transactional data (also called line items) appear in multiple rows.
-
Select a field in the column that contains the first line item information.
-
Right-click this data selection and select Add Repeat.
This adds a Repeat step with a GoTo step inside it. The GoTo step moves the cursor down to the next line, until there are no more lines (see Goto step). -
(Optional.) Add an empty detail table via the Data Model pane: right-click the Data Model and select Add a table. Give the detail table a name.
-
Select the Repeat step on the Steps pane.
-
Start extracting data (see Adding an extraction).
When you drag & drop data on the name of a detail table in the Data Model pane, the data are added to that detail table.
Dropping the data somewhere else on the Data Model pane creates a new detail table, with a default name that you can change later on (see Renaming a detail table).
The extraction step is placed inside the Repeat step, just before the GoTo step.