> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/more-details/applications/application-modules/union.md).

# Union

> Stack the rows of a and b, by column name or position.

Stacks the rows of `b` under the rows of `a`. `byName` matches columns by name and the result is `a`'s columns exactly: one missing from `b` arrives null, and one only in `b` is dropped without a word. Positional instead requires the two widths to match, and says so when they do not.

## At a glance

|                          |                        |
| ------------------------ | ---------------------- |
| Module type              | `Union`                |
| Category                 | Primitives · Dataframe |
| Default tier             | `reactive`             |
| Runs on                  | `reactive`, `durable`  |
| Starts a flow            | no                     |
| Holds a body             | no                     |
| Keeps state between runs | no                     |
| Available in             | every application type |

## Parameters

### `byName`

`boolean` · required · defaults to `true`

Match columns by name. Off, they are matched by position.

## Inputs

| Port | Kind        | Required | Description                                                                                                                           |
| ---- | ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| `on` | `event`     | no       | Implicit on every module that does not itself start a flow: wire an event here to make this module the start of what that event runs. |
| `a`  | `dataframe` | yes      | The first frame; its columns are the result's, in `byName` mode and positional alike.                                                 |
| `b`  | `dataframe` | yes      | The frame stacked underneath.                                                                                                         |

## Outputs

| Port     | Kind        | Connects to           | Description                       |
| -------- | ----------- | --------------------- | --------------------------------- |
| `output` | `dataframe` | `dataframe`, `signal` | Both frames' rows, in that order. |

***

[← All application modules](/more-details/applications/application-modules.md)
