> For the complete documentation index, see [llms.txt](https://help.sdocs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields.md).

# Inserting Merge Fields

Use this section to learn how merge fields bring Salesforce data into an S-Docs template.

Merge fields act as placeholders for record data.

When you generate a document, S-Docs replaces each field with the right value.

Start here to choose the guide that fits your template type and experience level.

{% hint style="info" %}
If you are new to merge fields, start with **Get Started With Merge Fields**.

Use **Merge Fields With Template Editor** for standard S-Docs templates.

Use **Merge Fields With Microsoft Templates** for DOCX, PPTX, and XLSX files, where merge fields must stay inside square brackets.
{% endhint %}

### Start with the path that fits your goal

If you are new to merge fields, start with the beginner guide.

If you are adding fields in the S-Docs editor, use the Template Editor guide.

If you are building a Microsoft template, use the Microsoft guide for the bracket syntax.

If you need a specific fix or formatting pattern, use the additional resources.

<table data-card-size="large" data-column-title-hidden data-view="cards"><thead><tr><th>Title</th><th>Description</th><th data-card-target data-type="content-ref">Target</th></tr></thead><tbody><tr><td><strong>Get Started With Merge Fields</strong></td><td>Start here if you are new to Salesforce merge fields and want a simple introduction.</td><td><a href="/spaces/v7v0UNK83URKB2C83QVU/pages/nSfm7H9DGgJEM3zlhQ6Y">/spaces/v7v0UNK83URKB2C83QVU/pages/nSfm7H9DGgJEM3zlhQ6Y</a></td></tr><tr><td><strong>Merge Fields With Template Editor</strong></td><td>Learn the standard merge field syntax, how to insert fields, and which attributes to use most often.</td><td><a href="/pages/K39Fafw2OEc3wBMe1WQC">/pages/K39Fafw2OEc3wBMe1WQC</a></td></tr><tr><td><strong>Merge Fields With Microsoft Templates (DOCX, PPTX, XLSX)</strong></td><td>Use the bracket-based syntax required for Word, PowerPoint, and Excel templates.</td><td><a href="/pages/U8Xd4cK0jx1TlpiiH2bU">/pages/U8Xd4cK0jx1TlpiiH2bU</a></td></tr><tr><td><strong>Additional Resources</strong></td><td>Jump to focused articles for apostrophes, mailing addresses, deep relationship paths, and rich text output.</td><td><a href="/pages/Y4AYeqROOBBy4NbESgVH">/pages/Y4AYeqROOBBy4NbESgVH</a></td></tr></tbody></table>

### What you can do with merge fields

* Insert record values into templates.
* Pull fields from parent and related records.
* Apply formatting for dates, numbers, and rich text.
* Use the right syntax for S-Docs and Microsoft templates.

### Browse by topic

* [Get Started With Merge Fields](/quick-start/template-building/how-to-auto-fill-customer-data-into-templates.md)
* [Merge Fields With Template Editor](/sdocs/template-architecture/inserting-merge-fields/merge-fields-with-template-editor.md)
* [Merge Fields With Microsoft Templates (DOCX, PPTX, XLSX)](/sdocs/template-architecture/inserting-merge-fields/merge-fields-with-microsoft-templates-docx-pptx-xlsx.md)
* [Additional Resources](/sdocs/template-architecture/inserting-merge-fields/additional-resources.md)

### Related note

Use [Format Data with Template Attributes](/sdocs/advanced-template-logic/template-attributes.md) when you need to control how merged values display after insertion.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
