Skip to main content
Skip table of contents

Convert to CSV

Input

✳️ Any (JSON)

(red star) Required: Array of Objects (Dataset)

Ouptut

✳️ Any (JSON) (Passthrough)

🆕 CSV Data (string)

Summary

Takes an array of objects (a tabular dataset) and converts it into a CSV file.

For example, given the following dataset:

JSON
[
  {
    "Make": "Toyota",
    "Model": "Camry",
    "Year": 2020,
    "Price": 24000
  },
  {
    "Make": "Honda",
    "Model": "Civic",
    "Year": 2019,
    "Price": 22000
  },
  {
    "Make": "Ford",
    "Model": "Mustang",
    "Year": 2021,
    "Price": 27000
  }
]

The following CSV dataset will be generated:

TEXT
"Make","Model","Year","Price"
"Toyota","Camry","2020","24000"
"Honda","Civic","2019","22000"
"Ford","Mustang","2021","27000"
Click to see the raw input and output objects...

Input Object

JSON
{
  "myData": [
    {
      "Make": "Toyota",
      "Model": "Camry",
      "Year": 2020,
      "Price": 24000
    },
    {
      "Make": "Honda",
      "Model": "Civic",
      "Year": 2019,
      "Price": 22000
    },
    {
      "Make": "Ford",
      "Model": "Mustang",
      "Year": 2021,
      "Price": 27000
    }
  ]
}

Output Object

Assumes that you’ve set the “Output Property” name to “myCsvData”.

JSON
{
  "myData": [
    {
      "Make": "Toyota",
      "Model": "Camry",
      "Year": 2020,
      "Price": 24000
    },
    {
      "Make": "Honda",
      "Model": "Civic",
      "Year": 2019,
      "Price": 22000
    },
    {
      "Make": "Ford",
      "Model": "Mustang",
      "Year": 2021,
      "Price": 27000
    }
  ],
  "myCsvData": "\"Make\",\"Model\",\"Year\",\"Price\"\n\"Toyota\",\"Camry\",\"2020\",\"24000\"\n\"Honda\",\"Civic\",\"2019\",\"22000\"\n\"Ford\",\"Mustang\",\"2021\",\"27000\""
}

Column Customization Tip!

If your column names are incorrect, or you’d like to filter your data before converting it to CSV, use the Select action before this one to refine your data.

Properties

Name

Type

Templatable

Notes

Field Delimiter

Choice:

  • Comma (,)

  • Tab (\t)

  • Pipe (|)

  • Semicolon (;)

  • Other

(error)

Select the field delimiter character.

For CSV files, this is usually a comma.

Custom Delimiter

Text

(error)

Only visible if Field Delimiter is “Other”. Enter one or more characters to use as the field delimiter.

Line Delimiter

Choice

  • CRLF (\r\n)

  • LF (\n)

(error)

Choose whether you want Windows (CRLF) or Unix (LF) style line endings.

Input Array

Text

(tick)

Enter an expression pointing to an array of objects to use as the input for the CSV data. Use the “array” function to cast the data as an array.

Example:

{{ input.myData | array }}

🅾️ Output Property

Text

(error)

Specify the name of the property to store the CSV data in.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.