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

# Create test datasets

> Build reusable test cases for Prompt Studio, import the support-ticket CSV, map variables and reference answers, and understand evaluation snapshots.

Use **Datasets** in Prompt Studio to test a prompt against many inputs. Each case contains values for your prompt's variables and, optionally, an expected output that an evaluation rule can use as a reference.

This guide imports eight synthetic tickets for the **Support ticket triage** prompt from the [Quickstart](https://docs.traceport.ai/prompt-studio/quickstart.md). You can reuse a dataset with other prompts in your organization when their input names and types match.

## Create the support-ticket dataset

**1. Create an empty dataset**

Open **Datasets** under **Resources** in the Studio sidebar. If the example already exists, open it. Otherwise, click **New dataset**, name it `Support ticket triage`, and click **Create dataset**.

The new dataset opens at **Variable settings**.

**2. Match the prompt's variable**

Click **Add variable** and enter:

| Setting | Value |
| - | - |
| **Variable name** | `ticket_text` |
| **Type** | `string` |
| **Required** | On |

Enter the name without braces. `ticket_text` matches `{{ticket_text}}` in your User message. Click **Save variable settings** before adding or importing cases.

**3. Preview the sample CSV**

Download [support-triage.csv](https://docs.traceport.ai/examples/prompt-studio/support-triage.csv), then click **Import CSV** and select the file.

Check the column mapping:

| CSV column | Map to |
| - | - |
| `ticket_text` | The `ticket_text` variable |
| `expected_output` | **Expected output** |

The preview shows the total case count and a sample of the rows. Confirm that ticket text appears as an input and the JSON reference answer appears as expected output. Resolve any import issues before continuing.

**4. Import and inspect**

Click **Import 8 test cases**, then open **Test cases**. An empty dataset now contains eight cases.

Open a row to read the complete ticket and expected output. The sample includes billing, account access, product failures, general questions, and a ticket that contains an instruction the prompt should treat as data.

![CSV import preview showing eight support-ticket cases, with ticket\_text mapped to the input variable and expected\_output mapped to Expected output.](https://mintcdn.com/traceport/qnQpjm16A9r4NqtM/images/prompt-studio/support-triage-import.jpg?fit=max\&auto=format\&n=qnQpjm16A9r4NqtM\&q=85\&s=d6eec63bf3b97e0bd8bb5bbd33bde349)

Preview the CSV mapping before importing. Reference answers belong in Expected output, separate from the prompt's variables.

## Inputs and expected output

For the first case, `ticket_text` contains the login failure affecting five agents. Its reference answer contains:

```json Reference answer theme={null}
{
  "category": "account",
  "priority": "high",
  "summary": "Five team members cannot sign in to the dashboard because of an Invalid session error, blocking customer support."
}
```

**Expected output** is optional reference content. It is not another prompt variable, it is not sent as an extra message in this example, and adding it does not automatically score a generated answer. Select [evaluation rules](https://docs.traceport.ai/prompt-studio/evaluations.md) to decide what to check.

The sample references describe intended answers. They do not require the model to reproduce the summary word for word. A Contains JSON rule does not compare the answer with this reference; semantic similarity does.

![Support ticket triage dataset showing eight imported test cases, a ticket\_text string column, and expected-output references.](https://mintcdn.com/traceport/qnQpjm16A9r4NqtM/images/prompt-studio/support-triage-dataset.jpg?fit=max\&auto=format\&n=qnQpjm16A9r4NqtM\&q=85\&s=90ff95d9e8dc8f15c191674fd2b13dfa)

The imported dataset contains eight cases. Open a row to read its full input and reference answer.

## Add or edit a case

To add another scenario, click **Add test case**, fill the defined variables, enter an optional **Expected output**, and save. This adds a case beyond the eight in the sample.

Open a case and click **Edit test case**, or use its row actions to choose **Edit**, when you need to correct it. Search **Test cases** to find inputs or expected outputs. Use **Export CSV** for the dataset, or select rows and choose **Export selected** for a subset.

Keep the input contract stable. While cases exist, existing variable names, types, and required settings are fixed. You can add optional variables. If your prompt needs a different input contract, create a separate dataset with matching settings.

## Prepare your own CSV

Use the prompt's variable names as headers and include `expected_output` only when you have reference answers. For example:

```csv Example CSV theme={null}
ticket_text,expected_output
"I forgot my password. How can I reset it?","{""category"":""account"",""priority"":""normal"",""summary"":""A customer needs help resetting a forgotten password.""}"
```

CSV values containing commas, quotes, or line breaks need proper CSV quoting. Export from your spreadsheet tool, or follow the sample file's doubled quotes around JSON fields.

The import supports files up to 10 MB and datasets with up to 500 cases. Import adds rows to the current dataset; importing the sample again adds another copy of its cases. Use **Skip column** for file columns you do not want to import.

## Evaluation snapshots

When you [run an evaluation](https://docs.traceport.ai/prompt-studio/testing.md), Studio saves the dataset inputs used for that run. See them listed under **Evaluation snapshots**. An unchanged dataset can reuse its existing snapshot.

Later edits affect future evaluations. They do not rewrite earlier run inputs, references, or scores. Deleting a case from the current dataset also leaves its existing evaluation snapshots intact.

To reuse an agreed correction from an evaluated or production output, follow [Human review](https://docs.traceport.ai/prompt-studio/review.md#reuse-the-final-correction). **Add test case** appends the reviewed inputs and final corrected answer and saves a new snapshot; it leaves existing rows and evaluation snapshots intact.

## Troubleshooting

| What you see | What to do |
| - | - |
| Import or add-case actions are disabled | Save **Variable settings** first and check whether the dataset has reached its case limit. |
| Missing or unknown variables | Match CSV mappings and dataset names to the variables in Build. Check spelling and types. |
| A type or row error in the preview | Fix the named row or mapping and preview again. Number, boolean, and JSON inputs must match the dataset's types. |
| A reference-based rule skips a case | Supply **Expected output** for rules that require a reference. A reference is optional for other rules. |
| Import fails after preview | The dataset may have changed. Preview the file again and recheck the available capacity. |
| No evaluation snapshots | Run an evaluation first. Creating or editing cases alone does not create an evaluation run. |

Next, create and test an [evaluation rule](https://docs.traceport.ai/prompt-studio/evaluations.md), then use **Evaluate dataset** or **Evaluate** to [run the saved prompt against these cases](https://docs.traceport.ai/prompt-studio/testing.md).


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