Tasks
Parse Data File
Parses stored CSV, JSON and Excel files. Save the result into stub data, return it in the task payload, or do both.
Supported formats are .csv, .json and .xlsx.
Basic usage
Parameters
fileuuid required string
The UUID of the file to be parsed.
fieldname optional string
The path in stub.data where the parsed contents will be saved, such as imports.customers.
Omit this parameter to return the parsed data without changing stub.data.
options optional object
Additional parsing and output options.
- return_savevalue: Whether to include parsed data as
payload.savevalue. Defaults totruewhenfieldnameis omitted andfalseotherwise. Set it explicitly to override the default. - sheet: For
.xlsxfiles, the sheet name or a sheet number starting at 1. Defaults to the first sheet.
CSV Options
- delimiter: The delimiter used in the CSV file. Default:
,. - quote: The quote character used in the CSV file. Default:
". - trim: If
true, trims whitespace from values. Default:true. - ignoreEmpty: If
true, ignores empty lines. Default:false. - noheader: If
true, treats the first row as data instead of a header. Default:false.
Properties
fieldname string
The data path where the parsed file contents were saved. Included when fieldname is supplied.
savevalue
The parsed data.
Included when options.return_savevalue is true, which is the default when fieldname is omitted.
Examples
Parse to a nested data path
Parses a file and saves the results to stub.data.results.json.
Return parsed data only
Parses the Customers sheet and returns its data as payload.savevalue, leaving stub.data untouched.
Save and return parsed data
Saves the Customers sheet into stub.data.imports.customers and returns both payload.fieldname and payload.savevalue.