Skip to main content

Export as File

Exports text content as a file with any extension.

Overview​

The Export as File node creates a file from text content. You specify the text (which can include expressions), a filename with any extension, and a destination. The text is encoded as UTF-8.

Use it to:

  • Generate JSON, XML, HTML, or any text-based file format
  • Save expression results as files
  • Create custom exports not covered by Export to Excel/CSV

Parameters​

ParameterDescriptionRequired
TextText content to write to the file (supports expressions and multiline)Yes
FilenameOutput filename with extension (e.g., output.json)Yes
File DestinationWhere to save the fileYes

Text​

The text content to export. Use expressions to include dynamic data:

{{JSON.stringify($item.data)}}

Or use multiline text for formatted output.

Filename​

The filename determines the file type by its extension. Any extension is accepted:

  • report.json
  • data.xml
  • page.html
  • config.yaml

Supports expressions: output-{{$item.data.id}}.json

Settings​

SettingDescription
Execution ModeOnce per item (default) or Once
Output ModeHow to output results when running once
Batch SizeItems to process concurrently (default 5)
Stop on ErrorStop workflow on failure

Output​

{
"file": {
"type": "fileData",
"name": "output.json",
"fileInfo": { "type": "..." }
}
}

Access in expressions:

  • File object: {{$item.data.file}}
  • File name: {{$item.data.file.name}}

Examples​

Generate JSON File​

[Import Table] → [Aggregate (collect all)] → [Export as File ("data.json")] → [Copy File]

Text: {{JSON.stringify($item.data.items, null, 2)}}

Create HTML Report​

[Import Table] → [Prompt AI ("Generate HTML report")] → [Export as File ("report.html")]

Text: {{$item.data.response}}

Export XML​

[Import Table] → [JS Code (build XML)] → [Export as File ("export.xml")] → [Send Gmail]

Tips​

  • The filename extension determines the file type — use any extension
  • Text content is encoded as UTF-8
  • Use expressions in both the text and filename parameters
  • For structured data (Excel, CSV), prefer the dedicated export nodes
  • Connect to Copy File or Send Gmail to distribute the exported file