> 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-selectable-contact-document-template.md).

# Creating a Selectable Contact Document Template

This lesson will show you how to create a more advanced document template using selectable contact fields.

Before you try this, you should know how to create a simple document template as shown in [this](/administrator-documentation/templates/creating-a-simple-document-template.md) lesson.

### Selectable mergefields

<figure><img src="/files/4BoOtlCIv3bgP5OpACHo" alt=""><figcaption></figcaption></figure>

Selectable mergefields are a subset of mergefields that allow you to select an element from your AgileCase system.

In this example, we will show a standard letter with a selectable contact field. Making a mergefield selectable involves changing the structure slightly.

{% stepper %}
{% step %}

#### Create a mergefield

Create a mergefield as normal by pressing `Alt+F9` to enter mail merge mode, then `Ctrl+F9` to open a field before typing `MERGEFIELD`.
{% endstep %}

{% step %}

#### Specify the area to select from

Specify the area you want to select from, for example `Case` or `Contact`, followed by a full stop.
{% endstep %}

{% step %}

#### Add a dropdown prompt

Enter an underscore followed by the text of your choice. This text will appear as the title of a dropdown menu when you create a document, so it should be a prompt such as `SelectClient`.

After this, enter another underscore followed by another full stop.
{% endstep %}

{% step %}

#### Enter the fields to display

Enter the name of the field you wish to be displayed, in this case `Name` and `Address Block`.
{% endstep %}

{% step %}

#### Save and upload the template

Once your selectable field is complete, save the document and upload it as a template.
{% endstep %}
{% endstepper %}

### Selecting a contact

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

When you create a document using a template with selectable mergefields, you will be prompted to select an option from a dropdown menu.

This will populate the document with information from the chosen option. It is possible to have multiple selectable fields in one template, as each will trigger its own dropdown menu.

### The selectable fields will be populated with your choice

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

When you create the document, it will be populated according to your choices for each selectable field.


---

# 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-selectable-contact-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.
