Data Pivot
Data Pivot changes the shape of your data between two common formats:
- A record with several fields, such as a customer’s details: name, city, phone.
- A list of rows with two columns, one with the field name and one with its value.
It helps when a destination, such as a spreadsheet or a report table, expects rows and what you have is a record, or the other way round.
When to use it
- Write an order’s details into a spreadsheet as a two-column table, “Field” and “Value”.
- Show a customer’s details one below the other in a report.
- Read a sheet of field-value pairs and turn it into a record another component can use.
- Prepare data extracted from a document so it can be reviewed line by line.
Configuration
| Field | What it does |
|---|---|
| Transform Mode | The conversion: Objet to List turns a record into rows; List to Object joins rows into a record. Default: Objet to List. |
| Data | The data you want to convert: a record for Objet to List, or a list of rows for List to Object. |
| Key Column Name | The name of the column that holds each field’s name. Default: COLUMN1. In List to Object, the component looks for the column with this name in each row. |
| Value Column Name | The name of the column that holds each field’s value. Default: COLUMN2. |
| Format Labels | Only for Objet to List. How field names are written: Keep Original, as they are; Replace Underscores with Spaces, which swaps underscores for spaces (start_date becomes start date); Title Case, which also capitalises the first letter of each word (Start Date). Default: Keep Original. |
Advanced options
Only shown for Objet to List.
| Field | What it does |
|---|---|
| Include Header Row | Adds a first row with the names of the two columns. Off by default. |
| Wrap List in Object | Returns the rows inside a record, in the data_list field, instead of as a plain list. On by default. |
In the Batch Mode tab you can connect a list to Batch Input to convert several records at once. See Batch Mode.
Output
The Output output returns:
- For
Objet to List, one row per field of the record, with the two columns you set. If a value is itself a list or a record, it is written as text in a single cell. With Wrap List in Object on, the rows come inside thedata_listfield. - For
List to Object, a single record with one field per row.
Example
A support team stores each incident’s details in a Google sheet, in a two-column layout.
- Connect the incident’s record to Data, with fields such as
customer,start_dateandpriority. - Leave Transform Mode as
Objet to List. - Enter
Fieldin Key Column Name andValuein Value Column Name. - In Format Labels, choose
Title Caseso the fields readCustomer,Start DateandPriority. - Connect Output to the component that writes to the spreadsheet.
Related components
- Flatten By Key: to turn a list inside a record into separate records.
- Merge Data: to combine several records.