> For the complete documentation index, see [llms.txt](https://docs.agilecase.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.agilecase.com/administrator-documentation/templates/creating-a-simple-document-template.md).

# Creating a Simple Document Template

This lesson will show you how to create a simple document template using non-selectable mergefields.

{% stepper %}
{% step %}

## Open Microsoft Word and write your stock email

<figure><img src="/files/WuI3yQEz5titopwN2Ekz" alt=""><figcaption></figcaption></figure>

Write your stock letter as a Word document, leaving blank the spaces that you wish to fill using AgileCase. For the purpose of this example, we have shown the content we intend to populate the spaces with in brackets.
{% endstep %}

{% step %}

## Fill in the gaps using mergefields

<figure><img src="/files/bezilfiNHMiEvVgwWFkr" alt=""><figcaption></figcaption></figure>

Now you can fill in the blanks using mergefields. Mergefields are a sort of reference for the template so it knows where to pull data from your AgileCase system. Once you have filled in all of your mergefields, the document template is complete and can be saved and uploaded to AgileCase.
{% endstep %}
{% endstepper %}

The rest of this lesson will look at the mergefields in this sample document in more detail and explain how to pull your own mergefields out of AgileCase.

## Viewing mergefields / XML feed

<figure><img src="/files/GBoDGJUKCznTFopBFMe8" alt=""><figcaption></figcaption></figure>

In order to simplify the creation of templates, AgileCase includes the functionality to view the mergefields present in each case so they may be picked out.

<figure><img src="/files/kr10BlADTBKmxYcaBVb8" alt="" width="347"><figcaption></figcaption></figure>

Clicking the arrow under the "Edit" button gives you the ability to view the merge fields present in the selected case.

This will take you to the Merge fields helper. The merge fields for the case will be listed along with their value, custom field ID and a copy option so they can be pasted into your templates. When you paste mergefields from AgileCase in this manner, you do not need to paste them in mail merge; they can be inserted directly into your Word document.

<figure><img src="/files/oUJ2YioZVzm0ajbC8pdJ" alt=""><figcaption></figcaption></figure>

It is also possible to view the original XML feed for the page. This can be done by selecting the "XML View" tab beside "Merge Fields". This can be of use to power users and has applications in case scripting.

## Formatting mergefields

<figure><img src="/files/OYqIXHwYzEO3YuNIFMX1" alt="" width="373"><figcaption></figcaption></figure>

You can apply specific formats to your mergefields. In order to edit a mergefield, you must enable mail merge by pressing `Alt + F9`.

Numbers do not always display with the correct formatting option, so a numeric picture switch in Word format is used. The switch shown here will correctly display currency with a decimal point. For example, a billing rate of £25 will be displayed as £25.00.

Users familiar with mail merge can create their own formatting options, but we suggest that inexperienced users make use of the formatting shown in our guide [here](/administrator-documentation/templates/document-template-mergefield-formatting-options.md), from which you can simply copy and paste a variety of standard formats into your mergefields.

As always, if you have any difficulties creating mergefields, do not hesitate to contact us on <support@agilecase.com>.


---

# 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://docs.agilecase.com/administrator-documentation/templates/creating-a-simple-document-template.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.
