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

# Adding data to Tracevell datasets

You can add datapoints either from file or by manually adding datapoints one-by-one.

## 1. Export from a span

You can export a span as a datapoint from both Traces and Evaluation traces. To do so,
select a span, click the span's name at the top of the span view to open its actions menu, and choose **Add to dataset**.

Select the dataset you want to export to and click "Add to dataset".

This will fill the `data` field of the datapoint with the input of the span and
the `target` field with the output of the span.

![Export span to dataset](https://mintcdn.com/laminarai/W6ojRY5YjRjfXRin/images/datasets/export-span.png?fit=max\&auto=format\&n=W6ojRY5YjRjfXRin\&q=85\&s=0753d1c4731518f8f48e0b88fb7191e1)

> [!TIP]
>
> To review or correct a span's output before it becomes a datapoint, choose **Add to labeling queue** from the same menu instead. A reviewer can edit the `target` in the queue and push the approved item to a dataset. See [Labeling queues](https://tracevell.com/docs/queues/quickstart.md#from-a-span).

## 2. File upload

You can upload datapoints from a structured file.

To do that, open the dataset, click **Import file** at the top of the page, and pick the file.

### File format

Supported file formats are: `.csv`, `.json`, `.jsonl`. We infer the format based on the file extension.

* csv - **header is required**, default separator and minimal quoting are assumed.
  If a row has an empty value or less values than headers, missing values will be filled with empty strings.
* json - the file must contain **one array** of datapoints.
* jsonlines - every line must contain one datapoint.

For each datapoint, we first construct the key-value object, and then parse it according to the following rules:

1. If keys are `"data"`, `"target"`, `"metadata"`, and `"id"`, we place them in the corresponding fields.
   * If we cannot parse `"id"` as UUID, we assign it a new random UUID.
2. Otherwise, all keys and values will go inside `"data"`.

If there is an error parsing the file, no datapoints will be added.
If a single value in the file does not conform to format, it will be silently ignored.

## 3. Add manually

Open the dataset and click **Add row** at the top of the page.
You can enter any value as long as it is a valid JSON that contains a `data` field.

![Add datapoint](https://mintcdn.com/laminarai/W6ojRY5YjRjfXRin/images/datasets/manual-add-dp.png?fit=max\&auto=format\&n=W6ojRY5YjRjfXRin\&q=85\&s=b637787700383e31e44b024068e298b8)

## 4. Enrich using a queue

You can create new datapoints by editing existing ones or copying span data using the queues.

Humans can then edit the datapoints in the queue and save them to new datapoints either
in the same dataset or in a new one. [Learn more about queues](https://tracevell.com/docs/queues/quickstart.md).


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