> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pdia-data-integration/pdi-transformation-steps-reference-overview/row-flattener.md).

# 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](https://773338310-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYwnJ6Fexn4LZwKRHghPK%2Fuploads%2Fgit-blob-0d45132c27bdef63c3b908fc2edfebace46403ac%2FPDI_RowFlattener_Dialog.png?alt=media)

| 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](https://773338310-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYwnJ6Fexn4LZwKRHghPK%2Fuploads%2Fgit-blob-f16b14de9cd7e9a15b6c1cce065746897996d394%2FPDI_RowFlattener_Dialog_Example.png?alt=media)

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

![Row Flattener results example](https://773338310-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FYwnJ6Fexn4LZwKRHghPK%2Fuploads%2Fgit-blob-c6e923372ad01bbca2f5f98977dce134e48d2650%2FPDI_RowFlattener_Dialog_Example2.png?alt=media)

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


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
