> For the complete documentation index, see [llms.txt](https://docs.mozark.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mozark.ai/no-code-studio/advanced/different-data-for-each-test-case.md).

# Different data for each test case

Sometimes the data does not change per device. It changes per **test**: same steps, different customer, different region, different expected result.

A data set keyed **per test case** does that: one row per test case, matched on the test case's name. For the per-device model, see [Test data](/no-code-studio/authoring-tests/test-data.md).

## 1. Create the test cases

**Test Cases → New test case.** Name it and save, for example `TC_UK`. It has no steps yet, and that is fine: the name is what the data set binds to, so it has to exist first.

Repeat for every scenario you want its own row of data: `TC_IN`, `TC_US`.

## 2. Create the data set

**Data Sets → New data set:**

| Field                       | Value                             |
| --------------------------- | --------------------------------- |
| Name                        | `Customers`                       |
| Which row does a test read? | **Per test case**                 |
| Value columns               | `name`, `phone_number`, `address` |

`test_name` is added for you as the key column.

## 3. Map the test cases to rows

Open the data set. The key cell is a **test case picker**, not a text box: click it and choose the test case by name, so the name can never be mistyped. Add one row per test case and fill in the values.

| test\_name | name        | phone\_number   | address            |
| ---------- | ----------- | --------------- | ------------------ |
| TC\_UK     | Alice Brown | +44 7700 900123 | 12 King St, London |
| TC\_IN     | Rahul Menon | +91 98765 43210 | 4 MG Road, Pune    |
| TC\_US     | Dana Reed   | +1 415 555 0134 | 900 Market St, SF  |

An **amber cell** means the test case that row names no longer exists: it was renamed or deleted. Pick the right one again.

## 4. Write the steps and use the data

Back on **Test Cases**, open `TC_UK` and click **Edit on device**. Pick a device and record your steps as usual.

To type a value from the data set instead of a literal:

1. Click into the step's field (the **Text** parameter) so it has focus.
2. In the Step Builder header, choose **... → Insert variable**.
3. Choose **Import from data set...**
4. Pick `Customers`, select `name`, and click **Insert**.

The field becomes `${name}`, and the picker shows the value it will use (`Alice Brown`) because you are editing `TC_UK`. Open `TC_IN` and the same `${name}` resolves to `Rahul Menon`. You never select the row; the test case's name picks it.

```
Enter Text   ${name}           →  Alice Brown
Enter Text   ${phone_number}   →  +44 7700 900123
```

If the test case you are editing has no row yet, the picker says so and offers **Edit data set**, so you can add it without leaving the recording:

```
No row for "TC_US" yet - this test would have no data to read.
```

{% hint style="warning" %}
Take that warning seriously. Unlike a device-keyed set, a test-case-keyed set does **not** fall back to another row. No row means the step has nothing to type.
{% endhint %}

## 5. Run them

**Test Suites → New test suite**, select the test cases and your devices, then **Run now**. Each test case looks up its own row; the device it lands on makes no difference. More on launching runs: see [Running tests](/no-code-studio/running-and-reporting/running-tests.md).

## Worth knowing

| Symptom                                   | Cause                                                             |
| ----------------------------------------- | ----------------------------------------------------------------- |
| A step types nothing                      | This test case has no row. Add one                                |
| Run rejected, `${name}` unresolved        | Same thing: the row is missing, or the column was renamed         |
| The row stopped matching                  | The test case was renamed. Re-pick it in the grid's key cell      |
| You need per-device **and** per-test data | Use two data sets, one keyed each way, and bind columns from both |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mozark.ai/no-code-studio/advanced/different-data-for-each-test-case.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
