Skip to content

CSV File

Reads and writes data from a csv file.

Categories: helpers

Type: csvFile/v1


Actions

Read from File

Name: read

Reads data from a csv file.

Properties

NameLabelTypeControl TypeDescriptionRequired
fileEntryFileFILE_ENTRYFILE_ENTRYThe object property which contains a reference to the csv file to read from.true
delimiterDelimiterSTRINGTEXTCharacter used to separate values within the line red from the CSV file.null
enclosingCharacterEnclosing CharacterSTRINGTEXTCharacter used to wrap/enclose values. It is usually applied to complex CSV files where values may include delimiter characters.null
headerRowHeader RowBOOLEAN
Options true, false
SELECTThe first row of the file contains the header names.null
includeEmptyCellsInclude Empty CellsBOOLEAN
Options true, false
SELECTWhen reading from file the empty cells will be filled with an empty string.null
pageSizePage SizeINTEGERINTEGERThe amount of child elements to return in a page.null
pageNumberPage NumberINTEGERINTEGERThe page number to get.null
readAsStringRead as StringBOOLEAN
Options true, false
SELECTIn some cases and file formats, it is necessary to read data specifically as string, otherwise some special characters are interpreted the wrong way.null

JSON Example

{
"label" : "Read from File",
"name" : "read",
"parameters" : {
"fileEntry" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
},
"delimiter" : "",
"enclosingCharacter" : "",
"headerRow" : false,
"includeEmptyCells" : false,
"pageSize" : 1,
"pageNumber" : 1,
"readAsString" : false
},
"type" : "csvFile/v1/read"
}

Write to CSV File

Name: write

Writes the data records into a CSV file. Record values are assembled into line and separated with arbitrary character, mostly comma. CSV may or may not define header line.

Properties

NameLabelTypeControl TypeDescriptionRequired
rowsRowsARRAY
Items [{}]
ARRAY_BUILDERThe array of rows to write to the file.true
filenameFilenameSTRINGTEXTFilename to set for binary data. By default, “file.csv” will be used.null

Output

Type: FILE_ENTRY

Properties

NameTypeControl Type
extensionSTRINGTEXT
mimeTypeSTRINGTEXT
nameSTRINGTEXT
urlSTRINGTEXT

JSON Example

{
"label" : "Write to CSV File",
"name" : "write",
"parameters" : {
"rows" : [ { } ],
"filename" : ""
},
"type" : "csvFile/v1/write"
}