# Previewing personalized content

See how your personalized content will look when populated with data.

When adding or editing content that contains [Handlebars](https://www.airship.com/docs/reference/glossary/#handlebars), preview the appearance with actual values from sample data. The sample data can come from a member of a [Preview Group](https://www.airship.com/docs/reference/glossary/#preview_test_groups) or from a random or specific [Contact](https://www.airship.com/docs/reference/glossary/#contact). You can also enter your own JSON sample data and override the data for any selected user. [Message namespace data](https://www.airship.com/docs/guides/personalization/sources/message-namespace/) is available in previews.

![Previewing personalized content in a message](https://www.airship.com/docs/images/personalization-example_hu_26c52160d455c1b3.webp)

*Previewing personalized content in a message*

Where message, [Template](https://www.airship.com/docs/reference/glossary/#template), and [Snippet](https://www.airship.com/docs/reference/glossary/#snippet) previews appear, select **View** for **Preview Data** to open the configuration drawer. To close it, select **Hide** or select the arrow icon in the **Preview Data** drawer. Select and hold the drag handle icon () to drag the Preview Data element to a new position on the screen.

   * For [Scenes](https://www.airship.com/docs/reference/glossary/#scene), first enable the Interactive mode [preview tool](https://www.airship.com/docs/guides/messaging/in-app-experiences/configuration/content/#preview-tools) to access the **Preview Data** option.
   * For email, Message Center, and landing page content, previewing is available within the [Interactive Editor](https://www.airship.com/docs/reference/glossary/#interactive_editor) only. When using the [WYSIWYG editor](https://www.airship.com/docs/guides/messaging/features/wysiwyg-editor/about/), select **Preview** to access the **Preview Data** option.
   * Previewing personalization is not available for [In-App Automation](https://www.airship.com/docs/reference/glossary/#iaa) messages or templates.

After configuring preview data, it persists in other screens within the same message, template, or Snippet. You do not have to reenter it. Within Sequences, preview data persists between the Manage and Performance screens and is independent of the preview data in individual messages.

## Configure a preview data source

After entering content that contains Handlebars, select **View** for **Preview Data**, and then configure a data source in the drawer:

<div class="table-scroll-wrapper">
<table width="100%" class="reference-table">
<col style="width:20%">
<col style="width:40%">
<col style="width:40%">
<thead>
<tr>
   <th>Source</th> 
   <th>Description</th>
   <th>Steps</th>
</tr>
</thead>
<tbody>
<tr>
   <td>Preview Group</td>
   <td>Populate the personalized content using data associated with a member of a [Preview Group](https://www.airship.com/docs/reference/glossary/#preview_test_groups). Use this source to validate content rendering for known users instead of relying on actual audience data.
   <td>Under <b>Source</b>, select <b>Preview Group</b>, select a group, and then select a member.</td>
</tr>
<tr>
   <td>Random Contact</td>
   <td>Populate the personalized content using data associated with a random user from the configured message audience. Use this source to validate content rendering for a range of actual audience members.<p>You can select from a list of up to ten users labeled with their channel type, such as <code>email</code>, <code>SMS</code>, or <code>iOS</code>. If the message does not require configuring an audience, or if the audience is All Users, the list is generated from all users in the project.</td>
   <td>Under <b>Source</b>, select <b>Random Contact</b>, and then select a user. Select <b>Refresh list</b> for different users.</td>
</tr>
<tr>
   <td>Specific Contact</td>
   <td>Populate the personalized content using data associated with a specific user in your project. Use this source to validate content rendering for known recipients.<p>You can search for a [Channel ID](https://www.airship.com/docs/reference/glossary/#channel_id), [Named User](https://www.airship.com/docs/reference/glossary/#named_user), email address, or [MSISDN](https://www.airship.com/docs/reference/glossary/#msisdn). Matches are labeled with their channel type, such as <code>email</code>, <code>SMS</code>, or <code>iOS</code>.</td>
   <td>Under <b>Source</b>, select <b>Specific Contact</b>, search for an identifier, and select from the results.</td>
</tr>
<tr>
   <td>Custom JSON</td>
   <td>Modify the data for a selected source or provide your own. Use custom JSON to simulate various personalization scenarios.</td>
   <td>Select <b>JSON</b>, then <b>Edit</b>, enter or modify the current data, then select <b>Apply JSON</b> to see the changes in the preview. Select <b>Reset</b> to restore the unedited data and refresh the preview.</td>
</tr>
</tbody>
</table>
</div>

## JSON sample data for Automations and Sequences

<!-- Need to verify the rest of this section re. automation vs non-automation -->

If your template or message is for an Automation or Sequence triggered by a [Custom Event](https://www.airship.com/docs/reference/glossary/#custom_event), you will want to use sample data based on that event.

Enter Custom Event properties representative of an audience member, mirroring the `properties` object in a [Custom Event object](https://www.airship.com/docs/developer/rest-api/ua/schemas/others/#customeventobject). See also [Personalize messages using Custom Events](https://www.airship.com/docs/guides/personalization/sources/custom-events/).

The following are a Custom Event and the JSON you would enter when configuring preview data for that event.

**Sample Custom Event**

```JSON
{
    "occurred": "{{event_time}}",
    "user": {
        "named_user_id": "user"
    },
    "body": {
        "name": "purchase",
        "subscribe": true,
        "properties": {
            "customer_name": "user",
            "total": 48,
            "cost_units": "USD",
            "purchase": [
                {
                    "qty": 4,
                    "item": "MLB regulation baseball",
                    "per": "$12",
                    "total": "$48"
                }
            ]
        }
    }
}
```


**Example JSON for previewing personalization**

```json
{
    "total": 48,
    "cost_units": "USD",
    "purchase": [
        {
            "qty": 4,
            "item": "MLB regulation baseball",
            "per": "$12",
            "total": "$48"
        }
    ]
}
```

