Output Filename Format

Created by Brian Glick, Modified on Tue, 4 Nov at 9:37 AM by Brian Glick


Overview

Within your Flow configurations you can specify a custom filename format to use for all output files produced during the Flow execution process. Filename modifications are the last step in a Flow execution before the generated files are transferred to the destination system to be sent to the designated trading partner. The file output format is specified using template variables. Each filename should be unique for easy identification and management. This feature is located in your Flow configuration settings under the Advanced Settings subsection. 


Example
When sending a purchase order XML document to trading partners, they may require the purchase order number or customer number to be a part of the filename to ensure proper routing. When configuring your Flow, you can designate an output filename format for the system to follow to produce purchase order files each with the corresponding purchase order number titled in the filename. 

 

Configuring a Custom Output Filename 

You can configure custom file names in the Output Filename Format field of the Advanced Options pane within a flow configuration.

Use the template variables in the table below to craft the custom file name format. The template variables list is also accessible in the Advanced Options subsection by clicking the question mark icon next to "Output Filename Format." 

Output Filename Format Template Variables 

Variable DescriptionExample Format Example Output 
File Name
{{index}}A number incremented for each file in the output payload, starting at "1".{{index}}.txt1.txt
{{uuid}}A unique identifier. {{uuid}}.txtbfea08cb-1639-4a5e-9ecd-e6394958e9c9.txt
{{epochms}}The datetime at which the file is renamed. {{epochms}} will always resolve to a unique millisecond value for each file in an Execution.{{epochms}}.txt1750941554002.txt
{{date}} Current date using 4 digit year, 2 digit month, 2 digit day formatting ("yyyy-MM-dd"). {{date}}.txt2025-06-26.txt
{{date "format"}}
  • Current date in specified format or in "yyyy-MM-dd"
    format - the format to follow when generating the date. Defaults to “yyyy-MM-dd”.
  • See Luxon documentation for more information.
{{date "yyyy-MM-dd'T'HH-mm-ss-SSS"}}.txt2025-06-26T12-39-14-002.txt
{{ext}} 
  • File extension from the corresponding source file.
  • If no source file extension is present, this will result in no output for this function.
file{{ext}}

Example filename:
testing.txt

Example output: file.txt


 

{{ext "default"}}
  • File extension from the corresponding source file, or the default value if no extension is present.
  • If no default value is provided and a source file extension could be found, the extension will be omitted.
  • default - the default value to output if no filename extension is found on corresponding source file.
{file{{ext "json"}}Example filename 1: testing.txt

Example output 1:
file.txt

Example filename 2:
testing

Example output 2: file.json
{{original_
basename}}
File name of the corresponding source file without the extension.prefix_{{original_
basename}}
Example filename:
testing.txt

Example output:
prefix_testing
{{original_
filename}} 
Fill file name of the corresponding source file, including the extension.prefix_{{original_
filename}}
Example filename:
testing.txt

Example output:
prefix_testing.txt
{{xpath "path/to/element"}} 
  • Execute the provided XPath expression against an XML file's contents.
  • Expressions that evaluate to an element will result in that element's text node being added to the filename.
  • Expressions that match to multiple result elements will result in the first matching element's text node being added to the filename.
  • Expressions that do not evaluate to any result will have no value inserted into the filename for that expression and a warning will be added to the execution log.
  • See Mozilla XPath documentation for more information
  • Attempting to run an XPath expression on a file that is not XML will result in the Flow erroring.
{{xpath "Root"}}.xml

Example file:
<document>Element Text</document>

Example output: Element Text.xml

{{jsonata "path.to.property"}} 
  • Execute the provided JSONata expression against a JSON file's contents.
  • Expressions that match to a sequence of multiple result properties will result in the first property being added to the filename.
  • Expressions that match to any properties that are NOT 'string', 'numeric', or 'boolean' JSON primitive types will be ignored and will produce a warning in the execution logs.
  • Expressions that do not evaluate to any result will have no value inserted into the filename for that expression and a warning will be added to the execution log.
  • See our JSONata Cheatsheet for examples and information.
  • Attempting to run a JSONata expression on a file that is not JSON will result in the flow erroring.
{{jsonata "property"}}.jsonExample file:
{"property": "value"}

Example Output: value.json

 

Example

Output file format: report_{{date "yyyy"}}_{{epochms}}_{{index}}{{ext}} 

Rendered output file name: report_2023_1699622449478_1.json.

 

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article