> 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/datasetoutput.md).

# Dataset Output

> Write the result back to a dataset.

Writes the frame it is given back to the workspace as a dataset.

`createNewPerRun` decides whether each run lands its own dataset or every run writes into `appendDatasetId`; `writeMode` then decides what writing means — replace the rows, append to them, upsert on `upsertKeys`, or merge.

## At a glance

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

## Parameters

### `selectedDatasetId`

`string` · required · defaults to `""`

The existing dataset to write into, when not creating one per run.

### `selectedDatasetName`

`string` · required · defaults to `""`

Its name when it was chosen, for the node's label.

### `outputName`

`string` · required · defaults to `"Dataset Output"`

The name new datasets are given.

### `createNewPerRun`

`boolean` · required · defaults to `true`

Land each run in its own dataset rather than writing into `appendDatasetId`.

### `appendDatasetId`

`string` · required · defaults to `"<minted per module>"`

Minted once so every run writes into the same dataset; ignored when `createNewPerRun` is set.

### `writeMode`

`"replace" | "append" | "upsert" | "merge"` · optional · defaults to `"replace"`

What writing means: replace the rows, append to them, upsert on `upsertKeys`, or merge.

### `upsertKeys`

`string[]` · optional

The columns an upsert matches on.

### `keyColumns`

`string[]` · optional

The columns a merge matches on.

## 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. |
| `data` | `dataframe` | yes      | The rows to write.                                                                                                                    |

## Outputs

*None.*

***

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