> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: Split Transformation

> Use the Split transformation to route each record to one of several named outputs by condition, with an optional Otherwise output.

## Overview

The Split transformation sends each input record down one of several named outputs, based on a condition you set for each output. Use it when records need different handling depending on their values. For example, send valid orders to your warehouse, refunds to a finance sheet, and everything else to an error log.

Split replaces the pattern of a Clone followed by several Filters with opposite conditions. With that pattern the conditions drift apart over time, and records are lost or duplicated. With Split, each record is evaluated once against an ordered list of conditions, so every record lands where you expect.

Every output carries the input's fields unchanged. Only the records differ.

## Configuration

**Step 1**

Drag a **Split** component onto the canvas and connect its input.

**Step 2**

Under **Send each row to**, choose **First match** or **All matches**.

**Step 3**

Each output has its own tab. Click **+ Add output** to add one, then on its tab enter a **name** and build its **condition** the same way as in the [Filter transformation](https://www.integrate.io/docs/etl/using-components-filter-transformation.md). A tab marked with a warning icon still needs a name or a condition.

**Step 4**

Optionally turn on **Add Otherwise output** to keep the records that match no condition.

**Step 5**

Connect each output connector on the canvas to the next component. Every output must be connected.

| Field | Description |
| :- | :- |
| Send each row to | **First match** (default): a record goes to the first output whose condition is true, so the order of outputs matters. **All matches**: a record goes to every output whose condition is true. |
| Outputs | 1 to 10 outputs. Each has a name, shown on its connector on the canvas, and a condition. Names must be unique, and **Otherwise** is reserved for the Otherwise output. Tabs are in output order and a new output is added last. To remove an output, click the trash icon on its tab. |
| Add Otherwise output | Adds an **Otherwise** output for records that match no condition. When it is off, those records are dropped and package validation shows a warning. |

### How records are routed

| Situation | First match | All matches |
| :- | :- | :- |
| Record matches one condition | That output | That output |
| Record matches several conditions | The first matching output only | Every matching output |
| Record matches no condition | Otherwise (if on), else dropped | Otherwise (if on), else dropped |
| A condition evaluates to null (for example, it compares a null field) | Counts as false; the record moves on to the next output | Counts as false |

In **First match** mode every input record lands in exactly one output when Otherwise is on, so the output record counts add up to the input count.

### Connections

* Every named output must be connected to exactly one component. A package with an unconnected output is not valid; the validation error names the output.
* Each output must go to a different component. Two outputs of the same Split can't be connected to one component, including a Union. To combine their records again, add a Select after each output and connect the Selects to the Union.
* To send one output's records to several places, connect it to a [Clone](https://www.integrate.io/docs/etl/using-components-clone-transformation.md) component.
* When **Add Otherwise output** is on, the Otherwise output must be connected too. Turning it off removes its connection.

### Previewing

Each output's tab has a **Preview** under its conditions that shows the records that output receives. When **Add Otherwise output** is on, an **Otherwise** tab previews the records no output takes. In **First match** mode an output's preview leaves out records an earlier output already took, exactly as the job does.

The preview reads a sample of source records. If none of them match an output's condition, that output's preview is empty even though a full run may fill it.

## Example

Orders arrive with an `email` and an `amount` field. Configure a Split in **First match** mode:

| Order | Output | Condition |
| :- | :- | :- |
| 1 | Valid | `email` is not null **and** `amount` > `0` |
| 2 | Refunds | `amount` \< `0` |
| Last | Otherwise | (on) |

| email | amount | Goes to |
| :- | :- | :- |
| [ann@example.com](mailto:ann@example.com) | 120 | Valid |
| [bob@example.com](mailto:bob@example.com) | -40 | Refunds |
| *(null)* | 75 | Otherwise (the Valid condition is not met and the Refunds condition is false) |
| *(null)* | *(null)* | Otherwise (the Valid condition is not met, and the Refunds condition evaluates to null, which counts as false) |

## FAQ

**Q: What is the difference between Split and Filter?**

Filter keeps the records that match one condition and drops the rest. Split routes every record to one of several outputs, each with its own condition, and can keep the unmatched records in an Otherwise output.

**Q: What is the difference between Split and Clone?**

Clone copies every record to all of its outputs. Split sends each record only to the outputs whose condition it matches.

**Q: Why does validation warn "Rows matching no condition will be dropped"?**

**Add Otherwise output** is off, so records that match none of the conditions are not sent anywhere. The package is still valid and runs. Turn the Otherwise output on and connect it if you need to keep those records.

**Q: Can a record go to more than one output?**

Only in **All matches** mode. In **First match** mode each record goes to one output at most.

## Related

> **[Filter Transformation](https://www.integrate.io/docs/etl/using-components-filter-transformation.md)**

> **[Clone Transformation](https://www.integrate.io/docs/etl/using-components-clone-transformation.md)**

> **[Assert Transformation](https://www.integrate.io/docs/etl/using-components-assert-transformation.md)**

> **[Using Expressions](https://www.integrate.io/docs/etl/using-expressions-in-integrateio-etl.md)**


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.