# Testing your Email with Preview Data


Use the Data tab in the Dyspatch Email Builder to power <glossary-term word="dynamic email content"></glossary-term> in your email previews. Preview Data can be built using the data builder or added as a JSON object, similar to what your system might use when passing data to an email for rendering.

<div class="highlight note">Preview Data is similar to <a href="/emails/using_customer_profiles">Customer Profiles</a>, each is data your team enters into Dyspatch to preview dynamic email content. Preview Data is unique to the email it is stored in, whereas Customer Profiles are available in the workspaces they're assigned to</div> 

## Building Preview Data Using the Data Builder

![Example of adding preview data in the data builder](https://docs.dyspatch.io/img/emails/data-builder.png)

Use the Data Builder in the Data > Preview Data tab in the Email Builder to create dynamic test data for that specific email.

Add the name of your variable and a value in the placeholder field. Any data type that is supported in JSON can be used in the Data Builder. This includes: strings, integers, booleans, arrays, and objects.

## Building Preview Data Using JSON

![Example of adding preview data in the json data builder](https://docs.dyspatch.io/img/emails/json-data-builder.png)

To add or edit Preview Data in JSON format, select the **Code editor** selector in the Preview Data tab. See more on how to use JSON data below.

## What is JSON?

JSON is a format for representing data with key and value pairs, used to store and exchange data. A JSON key has to be text wrapped in double quotes, e.g. "firstName". A JSON value can be text, numbers, lists, etc.

### An Example JSON Object

Below is an example of a JSON object, with some values: a string `"Kieran"`, a boolean `true`, a number `6`, a list of strings `["sushi", "pizza", "hash browns"]`, and a string inside of a nested object `"food and drink"`.

```json
{
  "firstName": "Kieran",
  "isPaidUser": true,
  "daysSinceLastLogin": 6,
  "favFoods": ["sushi", "pizza", "hash browns"],
  "userMetadata": {
    "likes": [
      "food and drink"
    ]
  }
}
```

### An Email Without Preview Data

![An email preview without preview data](https://docs.dyspatch.io/img/emails/preview-data-none.png)

Without preview data, variables will appear in the preview as they are entered, like `@{firstName}` above.

### Preview Data Errors

![Preview data error](https://docs.dyspatch.io/img/emails/preview-data-error.png)

Incorrect formatting of preview data will cause a warning to appear in your Preview Pane with a description of the error and an x on the line wit the error. The error in the example above is because JSON keys and values need a colon " : " between them on line 2. 

### Where is Preview Data Used?

Preview data is used in the Dyspatch Editor Preview Pane, for <glossary-term word="Device Previews"></glossary-term> and for test sending.

<div class="highlight note">
Preview Data and Customer Profiles are only for previewing in Dyspatch. Data they contain will not be used in your live emails.
</div>

## Using Preview Data in Emails
Once you have configured your preview data, you can now reference these data points in your email. In a particular field, click the `@` symbol to bring up a list of your associated data.

<img class="img-status img-border" src="https://docs.dyspatch.io/img/emails/preview-data-email-builder.gif" alt="Preview data in email builder dropdown selector"/>

## Next Step: Creating Personalized Emails
By adding robust data to your Preview Data, you can thoroughly test your emails before sending and feel good about personalizing emails with more dynamic content.
