We're going to go through 3 simple steps to achieve this:
Prerequisites
BEFORE STARTING
Basic Setup in Salesforce
STEP #1
Basic creation of the new template
Selecting the main object
Choose the main object: the Salesforce object will be the starting point for the generation, it is the basic context for creating a document
The tag label is automatically populated with the object's API name, but you can change it to make your document model easier to understand.
Generated file settings
Define the prefix, here we expect a text that will be fixed for all generations and that will compose the first part of the file name
Define the suffix, choose a field on the main object that will make up the 2nd part of the file name dynamically. Tip, you can create a formula field on the main object to have a more personalized file name
Choose the version management policy, and the desired output formats
Selecting the type of generation
Future : Future generation allows the document to be generated asynchronously, this means that the action will be executed in the background. In the case of a future generation, you will not be redirected to the document and it will be necessary to refresh the page to see the document
External : external generation makes it possible to generate a very heavy and complex document on Gonexa servers. In this case you will not be redirected to the document and it will be necessary to refresh the page after a few seconds to see the document.
This choice is grayed out by default on the document template, in order to benefit from it, contact your sales contact.

Creating child objects
Child objects are items that are linked to the main object. These are the “lists associated” with your main object. For example, we will have the “Opportunity Products” linked to an opportunity.
Important, it is not mandatory to have a child object to allow a generation. Only the main object is mandatory.

Choose the relevant Salesforce object
By default, the label is fed with the object's API name, but you can change it for greater clarity in the model
Add a filter if you want to filter the child records to be retrieved
Add sorting if you want to apply one for the results in the child table
Finalize this part by clicking on “Create”

For more details on children's objects, go to the article Manage tables
Design in Word
STEP #2
You can start from a document template that you already have or download a pre-designed template directly accessible via our page: Pre-designed templates
Create the static part of the document
Make sure to layout your document completely on the part that will not change at the time of generation
Simply provide tables in your word for everything that will concern “Child Objects” (ex: Opportunity Products)
Open the Assistant
In the template document, click on “Access Tags” in the Gonexa Assistant component
Allow the assistant to communicate with your Salesforce (to be done only once)
Set the window that opened with the main object and the child objects to the correct size
Inserting tags from the Assistant
You will need to know what information you want to dynamically generate in your template.
Click on the object in the Assistant to display the available fields
Use the search bar to filter
Click on the desired field (this field is copied to your clipboard)
All that's left to do is paste to the desired location in your document
You can also click on the arrows to navigate between object relationships and search for information related to the main object (move up relationships)
Configure the formatting of the tag with the Word standard (size, color, alignment, bold...)
💡 Astuce, vous pouvez ajouter la balise générique {!gnx|documentdateD} afin d'avoir la date de génération du document. Cette balise est également disponible dans l'Assistant.
Save the word to your computer
Make sure to save your word template in a clean directory to find it easily
For users of the Google Workspace suite with Google Doc, save your template in the format Word (.docx)
Important : It is recommended to keep the weight of the file as small as possible to optimize the generation
Publish your template
STEP #3
Adding the template to the template document
Go back to setting up the document template in Salesforce
Click on “Add a template”
Select on your word template from the file explorer
Click on “Open”
Wait a few seconds for the success message to appear
Typical mistakes
Make sure your template is in one of the following formats: “.docx” “.pptx” “.xlsx” or “.pdf”
In case of a red dot and incorrect tags, a Merge fields icon allowing you to check and verify the erroneous tags in order to correct them in your Word
Template testing

Your model is now available for generation to anyone who has the “Gonexa Doc Users permission sets” permission set.
Quickly access the content and the generated document
From the “Journals” tab, find the generations of your document template
Access the Log of your choice, click on Record to access the generation record
And click on Document to access the generated file
In the case of a log error, there is no Document generated

Document preview management
Your generated document appears in the standard Salesforce preview by default. You can overload it with the Gonexa preview.
From the page of your generated file, click on edit the page
From the custom components, drag and drop the Gonexa - File Preview action onto the page
💡 Tip, This gives your users access to useful commands such as printing, zooming, or quickly downloading the generated document.
Save
⚠️ Attention, If, when generating the document, the user cannot see the generated template, refer to the management of the document template sharing rules; if the user is in private, access to the template may be blocked if no sharing rule has not been created, we recommend that you change the sharing template setting to public (read-only).
Filter template visibility
STEP #4
[Optional] Make document generation available based on a criterion based on your main object.
Create a visibility condition
Go to the model configuration
Go to the “Filter the display of the model to users” section
Set the desired condition (s) and click on Validate
You can add as many conditions as needed and choose whether they should be strictly checked with AND or if one can be verified with OR.