> For the complete documentation index, see [llms.txt](https://university.gonexa.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://university.gonexa.fr/doc/en/getting-started/build-template/upload-document-template.md).

# Upload the document template

Only docx, xlsx, pdf or pptx files are supported.

## Add the template file to the document template

{% hint style="danger" %}
**Warning**

Only docx, xlsx, pdf or pptx files are supported.
{% endhint %}

* Go back to the document template configuration in Salesforce
* Click "Add a template"
* Select your Word template from the file explorer
* Click "Open"
* Wait a few seconds for the success message to appear

![Uploading the template](https://content.gitbook.com/content/U1Chwyf7Cc7FN9BiEh0V/blobs/OmannR7WKqDvBFFkQ6a1/08-07-mise-en-ligne-modele.gif)

## Check your tags

* If a red dot and incorrect tags appear, a Merge Field icon lets you check and review the erroneous tags so you can correct them in your Word document

## Document preview

The Preview feature lets you validate the layout and dynamic elements of a template, thanks to an accurate preview of the final document, before any full generation.

* In the Generation Test section, search for a record of your main object by its name or its ID
* Click the action arrow, then choose "Preview"
* The document opens in a new tab with the data of the selected record

![Document preview](https://4198981723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTYUzkIngX1MnHE8kOJDR%2Fuploads%2FSpVTnBVvb4x76By6xqaO%2Fconstruction-modele-4.png?alt=media)

## Test the generation

{% hint style="warning" %}
**Tip**

Generations in a Sandbox are not counted. Test without limits!
{% endhint %}

* Search for a record of your main object by its name or its ID, and select the record from which you want to test a generation
* Click "Generate"
* You are redirected to the generated document

Your template is now available for generation to everyone who has the "Gonexa Doc Users permission sets" permission set assigned.

Go back to your main object to see the template available for generation through the generation component.

![Generating the document](https://content.gitbook.com/content/U1Chwyf7Cc7FN9BiEh0V/blobs/HRSy2C6FQIhoi83HTokj/09-08-generation-document.gif)

## Quickly access the content and the generated document

* From the "Logs" tab, find the generations of your document template
* Open the log of your choice and click "Record" to access the record the document was generated from
* Click "Document" to access the generated file

If the log shows an error, no document is generated.

![Logs tab](https://content.gitbook.com/content/U1Chwyf7Cc7FN9BiEh0V/blobs/aQhKlIFAyMrcrOrBQtzY/10-09-onglet-journaux-corrigee.gif)

## Salesforce document preview management \[OPTIONAL]

By default, your generated document appears in the standard Salesforce preview. You can override it with the Gonexa preview.

{% hint style="warning" %}
**Tip**

The Gonexa Preview component provides faster PDF previews and access to various controls such as quick print, zoom or one-click document download.
{% endhint %}

* From the page of your generated file, click "Edit Page"
* From the custom components, drag and drop the "Gonexa - File Preview" action to the desired location on the page
* Save

{% hint style="danger" %}
**Warning**

If a user cannot see the template when generating a document, check the sharing rules of the document template. If it is set to Private, access to the template may be blocked. If no sharing rule has been created, we recommend setting the template's sharing setting to Public Read Only.
{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://university.gonexa.fr/doc/en/getting-started/build-template/upload-document-template.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
