Document Titles - Gavel

How to set a dynamic document name

  1. 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.

  2. Click the document name
    Click on the name of the document you want to rename. An editable name field appears.

  3. 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.

  4. 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.

Naming syntax

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

${ 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:

${ clientname } - Engagement Letter

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

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:

${ lastname + ' ' + firstname } - Retainer Agreement

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

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

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.

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.