> 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/manage-tables/create-table-in-template.md).

# Create a table in a template

Many use cases are possible, such as displaying the products, services and options linked to a sales opportunity, or the lists of contacts linked to accounts.

{% hint style="success" %}
**Example**

Many use cases are possible, such as displaying the products, services and options linked to a sales opportunity, or the lists of contacts linked to accounts.
{% endhint %}

## Add child objects in Salesforce

* In your document template, go to the "Gonexa Assistant" component
* Click "+ Child object"

![Interface for adding a child object](https://4198981723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTYUzkIngX1MnHE8kOJDR%2Fuploads%2FLBNj6jCzOnO5MIlTgUHx%2Fgerer-tableaux-1.png?alt=media)

* Select the Salesforce object linked to your context (e.g. Opportunity Products linked to the opportunity)
* Rename the tag label carefully if you want to have several tables on the same child object

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

Renaming the tag label will help you tell your tables apart and add the right tag to the right table when building the template
{% endhint %}

* Click "Create"

![Creating child objects](https://4198981723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTYUzkIngX1MnHE8kOJDR%2Fuploads%2FLqHhfSN323IEYSyyP9pd%2F15-01-creation-objets-enfants.gif?alt=media)

* Repeat the operation several times, each time with a correctly named label

{% hint style="success" %}
**Example**

You can create 3 child objects on the same Salesforce object, such as Opportunity Products, with the first labeled "Product", the second "Service" and the third "Option"
{% endhint %}

* Finish this part by clicking "Access Tags" to insert the tags into the final document

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

1 child object = 1 table in the document. Create as many child objects as you want distinct tables in the document template
{% endhint %}

![Editing a child object](https://content.gitbook.com/content/U1Chwyf7Cc7FN9BiEh0V/blobs/7VX4yKXhRZzfe2Ocu1K0/16-02-modification-objet-enfant.gif)

## Insert the tables in Word

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

This step is based on standard Word tables. To keep things simple, feel free to use our [Pre-designed templates](https://www.gonexa.fr/ressources/templates)
{% endhint %}

* Insert a new table with 2 rows and the number of columns of your choice
* The first row holds the fixed column names: name them as you wish. This is the table header.
* On the 2nd row, we will use the Assistant we opened earlier to insert the tags

![Example of a tag in a table](https://4198981723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTYUzkIngX1MnHE8kOJDR%2Fuploads%2F9gv73ylwIdtcLVXPEG6N%2Fgerer-tableaux-3.png?alt=media)

* Click the desired child object and look for the field matching what you want to put in your table
* Finish the template with all the fields you want to display

![Creating tables in Word](https://4198981723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTYUzkIngX1MnHE8kOJDR%2Fuploads%2Ffb7eWYHgKjj0bGRYVraf%2F17-03-creation-des-tableaux.gif?alt=media)

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

Tags for a child object must be placed inside a table. If they are outside a table, they will not appear when the document is generated.
{% endhint %}

To make things easier to understand, you can download the template shown in the training video.

[Download](https://cdn.prod.website-files.com/6266bdee7bba3ff58801d972/63e3a000578d3e64d8ee6d81_Gonexa%20-%20Mode%CC%80le%20-%20Devis.docx)

## Upload and test the template

* Go back to Salesforce and upload the Word template with the tables by clicking "Upload version"
* Make sure you have a test record with child records
* Test the generation to see the final result


---

# 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/manage-tables/create-table-in-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.
