# Merge Fields

If you are using document templates with Microsoft Word output format, you can use merge fields to pull information into those documents based on the details of your customers, bookings and proposals.

To insert a merged field, [open the template editor](/platform/day-to-day/sales-and-crm/crm/document-templates.md#to-edit-a-document-template) for one of your [document templates](/platform/day-to-day/sales-and-crm/crm/document-templates.md) and follow these steps:

Make sure the "master table" for the document is set to "Coworkers".

1. Clicking on "DATA" in the ribbon bar
2. Click on "Select Master Table"&#x20;
3. Select  "Coworkers"

![](/files/-LiipkUTcXywEu5hEiiA)

To insert a merge field:

1. Select the location in the document where to insert the merged field.
2. Click on "Insert Merge Field" and find the field name you would like to insert.
3. Click on the field name to insert into the document.

![](/files/-LiiqXUVG5G2ySBCNT_2)

Save the document using the "File" menu.

![](/files/-Liiqy9w4Oaz-blN51tH)

## Available Merge Fields

Document templates can be used to generate documents based on the data from customers, bookings and proposals. Depending on the record you use to generate the document different data would be available in the template.

#### Customer data

Documents generated for customers, bookings and proposals have access to customer data. This is always set as the "Master table" for documents. Customer merge fields are available directly in the "Insert Merge Field" menu.

If the booking you are generating a document for has no associated customers, customer data will not be available when generating the document.

![](/files/-LiirhfORx2FzLm3qB2D)

#### **Contract Data**

Contract data is available do documents generated for customers, bookings and proposals. To access Bookings merge fields, click on "Insert Merge Field" and scroll all the way down to "ActiveContracts" or "NewContracts".&#x20;

* "ActiveContracts" is data for any contract that is already active or past their start date.
* "NewContracts" are contracts, active or not, for which you have not yet issued any invoices.

![](/files/-LiityJ58zJ-A4u4g2mo)

#### **Recurrent Products**

Recurrent product data is available for documents generated for a customer or a proposal. To access Bookings merge fields, click on "Insert Merge Field" and scroll all the way down to "RecurrentProducts".&#x20;

"RecurrentProducts" are those products you have added to a customer and marked as to repeat following the main contract cycle, daily, weekly, monthly or yearly.

![](/files/-LiiuW6tXDhdYq2x4R3X)

#### **Booking Data**

Booking data is available to documents generated for a booking. To access Bookings merge fields, click on "Insert Merge Field" and scroll all the way down to "Bookings"

![](/files/-LiitHWo9eFEFIpLjDgA)

#### Proposal Data

Proposal data is available to documents generated for a proposal or for a customer. The main difference is that, when generated for a customer, all proposals for that customer will be available while, when generated for a proposal, only data for that proposal will be made available to the document.

### Formatting Merge Fields

For dates and numbers fields, for example when showing the price of a contract or the start date for contracts, you may want to format these based on your local formatting rules.

Right click on any merge field and click on **Field Properties.**

![](/files/-Lmxj0HYltn1WCbNlO_n)

Use the **Numeric Format** or **Date / Time Format** fields to provide a format expression.

![](/files/-LmxjBgZdXIifeEJz53e)

#### Dates:

Use **yyyy** for year, **MM** for month and **dd** for day. For example yyyy/MM/dd or yyyy-MM-dd.

**Numbers**

Use **0.00** to format numbers with 2 decimal points.

For advanced formatting expression, check [**this**](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings) and [**this**](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings) articles for dates and [**this**](https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings) and [**this**](https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-numeric-format-strings) articles for numbers.


---

# 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://legacydocs.nexudus.com/platform/day-to-day/sales-and-crm/crm/document-templates/merge-fields.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.
