> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/template-architecture/template-settings/advanced-options-tab/how-to-set-up-template-preview.md).

# How to Set Up Template Preview

Template Preview lets you test document output with a real Salesforce record before users generate it.

This helps you catch layout issues, missing data, and overflow early.

### Set up template preview

{% stepper %}
{% step %}

### Open advanced settings

Open the **Advanced Options** tab in the Template Editor.
{% endstep %}

{% step %}

### Enter a preview record

Under **Advanced Template Settings**, find **Preview ID**.

Paste a valid `15`- or `18`-character Salesforce record ID.
{% endstep %}

{% step %}

### Trigger preview mode

Click outside the field.

The **Save & Preview** button appears at the top of the editor.
{% endstep %}

{% step %}

### Generate the preview

Click **Save & Preview**.

A new tab opens with the generated document for that record.
{% endstep %}
{% endstepper %}

### Find a record ID

Open a representative Salesforce record.

Copy the alphanumeric ID from the end of the browser URL.

Example:

```plaintext
https://yourinstance.salesforce.com/006Q000001AbCDEF
```

In this example, `006Q000001AbCDEF` is the record ID.

### What preview shows

Preview shows the generated document output, including:

* merge field data
* conditional rendering
* page breaks and formatting

### What preview does not show

Preview does not test:

* email settings
* file naming behavior
* task creation or attachment creation

Runtime prompts also use blank or default values during preview.

### Best practices

* Use dedicated test records with realistic data.
* Include long text and multiple related records.
* Label test records clearly so users do not change them.

{% hint style="info" %}
Template Preview respects the current user's Salesforce permissions and sharing rules.
{% endhint %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.sdocs.com/sdocs/template-architecture/template-settings/advanced-options-tab/how-to-set-up-template-preview.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
