> 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/enhanced-template-editor/preview-and-publish-templates.md).

# Preview & Publish Templates

The Enhanced Template Editor features an updated workflow for saving, previewing, and publishing your templates. This update introduces the Draft and Unpublished Changes states for templates, designed to ensure only fully validated templates are deployed to live document generation workflows.

### Publishing and Updating Templates

A template will not become active for end-user document generation until it is explicitly published.

#### Initial Publishing

Once your initial template design is complete, click **Publish**. The indicator in the *Status* tab will change to *Published*, making the template immediately available for document generation.

#### Making Changes to Active Templates

If you modify a template that is already active, your new changes will save automatically as an unpublished draft.

* The document generation engine will continue to use the previously published version of the template.
* To push your new updates live, you must click **Update Template** to make any changes active for generation. This action replaces the previous active version and changes the status tab indicator back to a *Published* icon.

#### Understanding Template Statuses

When you create or modify a template in the Enhanced Template Editor, your progress is saved automatically. However, the template will alternate between three core lifecycle statuses:

<table><thead><tr><th width="305.16796875">Status</th><th>Summary</th></tr></thead><tbody><tr><td><img src="/files/tBsMwmZ3XVFSoKZHzuWZ" alt="" data-size="original"></td><td>The template contains unpublished changes and is not yet active for use in generation workflows.</td></tr><tr><td><img src="/files/rtOycmOOPzvXAhasxbmy" alt=""></td><td><p>A published template undergoing maintenance or edits.</p><div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Document generation workflows will continue to use the previously published version of the template until newly made edits are published.</p></div></td></tr><tr><td><img src="/files/aX0ubPJilQndH8ugB8vK" alt=""></td><td>The template is active, finalized, and ready for live document generation.</td></tr></tbody></table>

### Previewing a template

To ensure your template renders correctly before making it live, you can use the built-in preview functionality to resolve merge fields using a live record. Merge fields within the editor are fully declarative and can be easily rearranged using drag-and-drop actions.

<figure><img src="/files/jKxaPykV6t7S69X0y1y0" alt=""><figcaption></figcaption></figure>

To preview a template:

1. Click the down arrow icon located on the right side of the Preview button.
2. Select a record from the list (Search functionality included for quick navigation).
3. Click the preview action to launch the document in a new lightning tab and review the template with merge field data resolved.


---

# 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/enhanced-template-editor/preview-and-publish-templates.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.
