# Row Flattener

The Row Flattener step flattens sequential rows into columns.

Use this step when your source data is organized in consecutive rows where each row represents an attribute, and you want to turn those rows into a single row with multiple columns.

### General

![Row Flattener step](/files/jmHP0s7h6dPcXRmmmXi1)

| Field                    | Description                                                                                                             |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------- |
| **Step name**            | Specify the unique name of the Row Flattener step on the canvas. You can customize the name or leave it as the default. |
| **The field to flatten** | Name of the incoming field to flatten.                                                                                  |
| **Target field**         | Names of the output fields that receive the flattened values.                                                           |

### Example

Suppose your file contains company order information, with one attribute per row. Each order is described by three rows:

```
Land of Toys Inc.
United States
10107
Lyon Souvenirs
France
10134
Australian Gift Network, Co
Australia
10374
Gift Depot Inc.
```

Using the following settings in the Row Flattener step, the rows are flattened into three target fields:

![Row Flattener entry example](/files/tZ041StrLOxbHVKUnkUw)

The resulting data set is shown below. For every three rows, the data is formatted into a single output row.

![Row Flattener results example](/files/dYjrEXDCYKZwcRoc4FHA)

{% hint style="warning" %}
Incomplete or non-consecutive data can lead to unexpected results.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/row-flattener.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
