> ## Documentation Index
> Fetch the complete documentation index at: https://helpdocs.gavel.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Document Titles

> Use variable values in your generated document file names so each output is automatically named after the client, matter, or other questionnaire answer.

By default, each generated document is named after the template file it was produced from. The naming convention feature lets you include the value of any workflow variable in the document's title, so the finished file is automatically named after the client, matter, date, or any other answer collected in the questionnaire. You set this up in the **Document Templates** tab — no additional configuration is required.

## How to set a dynamic document name

<Steps>
  <Step title="Open the Document Templates tab">
    In your workflow, navigate to the **Document Templates** tab. You will see the list of templates attached to this workflow.
  </Step>

  <Step title="Click the document name">
    Click on the name of the document you want to rename. An editable name field appears.
  </Step>

  <Step title="Enter the naming convention">
    Type the name you want the generated file to have. To include a variable value, use the `${ }` syntax anywhere in the name field. You can mix plain text and variable expressions.
  </Step>

  <Step title="Save your changes">
    Click out of the field or press Enter to save. From now on, every document generated from this template will use the naming convention you defined.
  </Step>
</Steps>

## Naming syntax

Variable values are inserted into document names using a dollar sign and single curly brackets:

```text theme={null}
${ variable_name }
```

This is different from the double-curly-bracket syntax used inside Word document templates. In document names, always use `${ }` (one set of curly brackets with a dollar sign).

### Single variable example

To name each generated file after the client, where the variable is `clientname`:

```text theme={null}
${ clientname } - Engagement Letter
```

If the variable value is `Jane Doe`, the generated file will be named:

```text theme={null}
Jane Doe - Engagement Letter
```

### Multiple variables example

You can include more than one variable inside the same `${ }` expression by joining them with `+`. To include a last name and first name with a space between them:

```text theme={null}
${ lastname + ' ' + firstname } - Retainer Agreement
```

If `lastname` is `Smith` and `firstname` is `John`, the generated file will be named:

```text theme={null}
Smith John - Retainer Agreement
```

You can insert any string literal between variables using single quotes, including spaces, hyphens, commas, or any other separator character that makes sense for your naming scheme.

### More examples

| Naming convention                           | Example output                              |
| ------------------------------------------- | ------------------------------------------- |
| `${ clientname } - NDA`                     | `Acme Corp - NDA`                           |
| `${ lastname }, ${ firstname } - Will`      | `Smith, John - Will`                        |
| `${ mattername } - ${ documenttype }`       | `John and Jane Doe Trust - Trust Agreement` |
| `Contract - ${ clientname } - ${ today() }` | `Contract - Jane Doe - 2025-04-13`          |

<Note>
  The `${ }` syntax in document names is evaluated at the time the workflow is run, so each document gets the actual value the user entered — not a placeholder. If a variable has no value (the question was left blank), that portion of the name will be empty.
</Note>

<Tip>
  Include a descriptive static portion in every document name alongside the variable values. This makes it easier to identify documents in the Data Manager and in email attachments, especially when multiple documents are generated from the same workflow.
</Tip>
