Skip to main content

Export to CSV

Creates CSV files from workflow data.

Overview

The Export to CSV node generates comma-separated value files from your data. Use it to:

  • Create simple data exports
  • Generate files for import elsewhere
  • Produce lightweight data files

Parameters

ParameterDescriptionRequired
DataData to exportYes
FilenameName for the CSV fileYes
File DestinationWhere to save the fileYes

Data

The data to export. Accepts multiple formats:

Array of objects:

{{$item.data.rows}}

Object keys become column headers.

2D array:

{{$item.data.matrix}}

First row can be headers.

String:

{{$item.data.csvContent}}

Already-formatted CSV content.

Filename

Name for the output file. The .csv extension is added automatically if not included:

export
{{$item.data.reportDate}}_data

Output

The item passes through with file information added:

{
"file": {
"name": "export.csv",
"mimeType": "text/csv",
"size": 5432
}
}

Examples

Basic CSV Export

Export filtered data:

[Get Table] → [Filter] → [Aggregate: COLLECT_ARRAY] → [Export to CSV]
  1. Use Aggregate to collect items into array
  2. Data: {{\$item}}
  3. Filename: export
  4. File Destination: Your folder

Prepared Data Export

Clean data before export:

[Get Table] → [Edit Item: select fields] → [Aggregate] → [Export to CSV]

Use Edit Item with "Keep no fields" to select only the columns you want.

Dynamic Filename

Include date in filename:

  • Filename: {{new Date().toISOString().split('T')[0]}}_export

Produces: 2024-01-15_export.csv

Export from 2D Array

If your data is already a matrix:

  • Data: {{\$item.data.matrix}}

The 2D array exports directly to CSV.

CSV Format

The CSV output:

  • Uses comma delimiters
  • Includes header row from object keys
  • Quotes values containing commas or newlines
  • Uses UTF-8 encoding

Tips

  • CSV is simpler and smaller than Excel
  • Use Aggregate to collect items into array first
  • Object keys become column headers
  • Use Edit Item to control which fields and their order
  • CSV doesn't support multiple worksheets
  • Good for data interchange with other systems