File naming patterns
Build dynamic output file names with naming tokens, plus per-output overrides and collision handling.
Output files don't have to be named by hand. In a template's Output settings you write a Filename Pattern out of tokens — ${filename}, ${date}, and the rest — and Scanix Desktop fills them in for every document it exports. This page is the reference for every token, the per-output override, and what happens when a name already exists on disk.
Where you set it
Open the template's Output section. The Filename Pattern card holds a single Pattern field and a row of token chips you can click to append. Each Output Destination below it can also carry its own Filename Pattern Override. Leave an override empty and the destination falls back to the global Pattern.
Screenshot
The Filename Pattern card with the Pattern field and the clickable token chips (${filename}, ${date}, ${timestamp}, ${counter}, ${FieldName}). — shot export-file-naming-01
Naming tokens
Type tokens directly into the Pattern field, or click a chip to append it. Anything that isn't a recognised token is kept literally, so INV_${date} exports as INV_2026-06-27. The resolved name is sanitised for the filesystem — the characters < > : " / \ | ? * are each replaced with _.
| Token | Resolves to | Example output |
|---|---|---|
${filename} | The source file's name, with its extension stripped | scan_001 |
${date} | The current date, formatted YYYY-MM-DD | 2026-06-27 |
${timestamp} | A Unix timestamp in milliseconds | 1782604800000 |
${counter} | The document's position in the import — or, on a combined output, the document count (see Tokens and combined files) | 3 |
${FieldName} | The value of an index field, addressed by its field name (with spaces written as underscores) | ${Invoice_No} → INV-4471 |
A pattern of ${filename}_${date} on a file named scan_001.pdf therefore exports as scan_001_2026-06-27.
Use ${filename} for the source file's name
To put the source file's name in the pattern, use ${filename}. A field token written without an underscore (for example ${Invoice No}) is not recognised either — always use the underscore form, such as ${Invoice_No}.
Index field tokens
${FieldName} lets you name files from captured data — for example ${Invoice_No}_${date}. Address a field by the name shown in the template, writing any spaces in the name as underscores: a field called Invoice No is referenced as ${Invoice_No}. A token written with a literal space (${Invoice No}) is not recognised and is left in the filename as-is, so always use the underscore form.
If a field has no value
When the named field has no captured value for a document, the token resolves to its own name rather than a blank — so an empty ${Invoice_No} lands in the filename as the literal text Invoice_No. Keep a ${date} or ${filename} token in the pattern so every output still gets a unique, recognisable name.
Per-output Filename Pattern Override
Every Output Destination has its own Filename Pattern Override field at the bottom of its card. Use it when one destination needs a different naming scheme from the rest — a PDF archive named by invoice number, say, while a sidecar export keeps the source filename.
| Override field | Behaviour |
|---|---|
| Empty (placeholder Leave empty to use global pattern) | The destination uses the template's global Filename Pattern |
| Set to a pattern | That destination uses the override; the global Pattern is ignored for this destination only |
The override accepts exactly the same tokens as the global pattern.
Screenshot
An Output Destination card with the Filename Pattern Override field and its Leave empty to use global pattern placeholder, above the Collision Handling dropdown. — shot export-file-naming-02
Collision handling
When the resolved name already exists in the destination folder, the output's Collision Handling setting decides what happens. The default is Auto-increment.
| Option (label in the dropdown) | What it does |
|---|---|
| Auto-increment (_001, _002…) | Appends _001, _002, … until the name is unique, then writes the new file. Nothing is overwritten. (Default.) |
| Overwrite | Writes over the existing file at that exact name. |
| Error if exists | Stops the export for that file and reports an error instead of writing. |
Auto-increment is the safe default
With Auto-increment, two documents that resolve to the same name — common when a pattern is just ${date} — never clobber each other; the second becomes …_001, the third …_002, and so on. Choose Overwrite only when re-running a job is meant to replace its previous output, and Error if exists when a duplicate name should halt the run for review.
Tokens and combined files
A single output can export one file per document or combine all documents into one file (see Combined vs separate files). The same pattern drives both, but a few tokens resolve differently because a combined file has no single source document:
| Token | Per-document output | Combined output |
|---|---|---|
${filename} | That document's source name | The first document's name, as a fallback for the batch |
${FieldName} | The document's field value | No single-document value — resolves to its own name |
${counter} | The document's position in the import | The number of documents combined into the file |
Because a combined file has no single source document, prefer ${date}, ${timestamp}, or ${counter} in a combined output's pattern so the name is meaningful and unique — for example batch_${date}. To make per-document names unique, use ${date}, ${filename}, or an index field.
Next steps
Export overview
Formats, destinations, and how documents are filed across a template's outputs.
Combined vs separate files
Export one file per document or merge a batch into a single file.