Skip to main content

CSV Component

Build and parse CSV files to and from JavaScript arrays

Component key: csv

Description

CSV is a delimited text file format that uses a comma to separate values. The CSV component gives you the ability to parse and generate CSV files from JavaScript Arrays. You can also specify a custom delimiter character when building and parsing CSV files.

Actions

Generate (Deprecated)

Generates a CSV file from an array of objects | key: generate

InputDefaultNotesExample
Delimiter
string
delimiter
,
Provide a string value containing the character the file is delimited on.
 
Data
string
/ Required
Value List
rowData
 
For each list item, provide a list of strings that represent a row in the file.
{key: "value"}

Generate CSV From Array

Generates CSV data from an array of objects | key: generateFromObject

InputDefaultNotes
Delimiter
string
delimiter
,
Provide a string value containing the character the file is delimited on.
Include Header?
boolean
includeHeader
true
 
Input Array
code
inputArray
This should be an array of un-nested objects

Parse

Parse CSV data into an array of rows | key: parse

InputDefaultNotesExample
CSV Data
text
/ Required
csv
 
Provide a string containing one or more rows of comma-seperated data
Column 1,Column 2 foo,bar abc,def
Delimiter
string
delimiter
,
Provide a string value containing the character the file is delimited on.
 

{
"data": {
"data": [],
"errors": [],
"meta": {
"delimiter": ",",
"linebreak": "",
"aborted": false,
"truncated": false,
"cursor": 385
}
}
}