# Preview Document

### Introduction to Preview Mode

The "Preview" tab allows you to test your template using real or sample data—helping you validate formatting, conditions, and logic before publishing or exporting.

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2F1tTL8u021nWnYoKbfYjv%2Fimage.png?alt=media&#x26;token=8966a35e-7a57-4abe-8465-9f893a1da30c" alt=""><figcaption></figcaption></figure>

### Using the Preview Feature with Airtable Data

This option is available if you're using the [Airtable Connection](https://docs.documint.me/templates/working-with-dynamic-data/connections/airtable-connection). This mode simulates rendering your template with live Airtable data without making any actual updates to Airtable itself:

1. Click the "Preview" tab in the top navigation bar.
2. Under Test Data, select "Airtable".
3. Your fields will populate based on that table’s structure and linked records.
4. You can test multiple records to test looping, conditionals, and formatting across a variety of data using the records dropdown.

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FnGY7xJ25CrWNgH58Ek6r%2Fimage.png?alt=media&#x26;token=3c1e5053-c1fb-40fe-bafc-c1a0cead1ba9" alt=""><figcaption></figcaption></figure>

### Using the Preview Feature with Manual Data

When using Manual mode in the Preview tab, the system will auto-generate a form based on your schema.

* Form Fields: Are dynamically created from the structure of your schema—each field corresponds to a key in your data model.
* Data Types: Are automatically inferred from the schema (e.g., strings, numbers, booleans, lists), so the form uses appropriate input types like number fields, or text inputs.
* You can override or populate only specific fields to test conditional rendering, visibility logic, loops, and more.

This allows for quick and intuitive testing without writing raw JSON, while still giving you full control over the preview data.

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FVXOtJicRnlaauG80c6rN%2Fimage.png?alt=media&#x26;token=2638ff7d-595e-4c52-91cd-42a3ad7893ee" alt=""><figcaption></figcaption></figure>

### Toggling Between Design and Preview Modes

* Use the Design tab to build and structure your document.
* Use the Preview tab to see how it renders with actual data.
* Switch back and forth at any time—changes in the design are immediately reflected in the preview.

This workflow helps you refine structure and logic iteratively before deploying.

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FxGRogpZLqI6DErRi7xmC%2Fimage.png?alt=media&#x26;token=1c8326b1-c986-4427-94dc-b0da09764437" alt=""><figcaption></figcaption></figure>

### Testing Conditional Logic in Preview

* Any logic you’ve set in the Conditions Editor or Repeat/Loop tab will be evaluated in real time during preview.
* Examples:

  * Fields that should be hidden if values are missing

  * Loops that only render if a list has items

  * Different layouts are shown for different roles or statuses

  > Tip: Test using data variations (e.g., with/without optional fields) .

In the next section, we’ll explore some tips and best practices to help you design efficient, scalable, and maintainable templates.


---

# Agent Instructions: 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:

```
GET https://docs.documint.me/introduction/basic-tutorials/preview-document.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
