> 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

Learn how merge fields work in S-Docs, then choose the right guide for Template Editor, Microsoft templates, or focused troubleshooting.

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="/quick-start/template-building/how-to-auto-fill-customer-data-into-templates.md">Auto-fill customer data in Document Templates</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="/sdocs/template-architecture/inserting-merge-fields/merge-fields-with-template-editor.md">Merge Fields With Template Editor</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="/sdocs/template-architecture/inserting-merge-fields/merge-fields-with-microsoft-templates-docx-pptx-xlsx.md">Merge Fields With Microsoft Templates (DOCX, PPTX, XLSX)</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="/sdocs/template-architecture/inserting-merge-fields/additional-resources.md">Additional Resources</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 by asking a question.

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

```
GET https://help.sdocs.com/sdocs/template-architecture/inserting-merge-fields.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.
