CSV to JSON V1

Know the component and how to use it.

Erick Rubiales avatar
Written by Erick Rubiales
Updated over a week ago

IMPORTANT: This documentation has been discontinued. Read the updated CSV to JSON V1 documentation on our new documentation portal.

CSV to JSON V1 transforms a CSV into a JSON object.

Take a look at the configuration parameters of the component:

  • Headers: list of headers to be read - each CSV header is converted into a JSON property.

  • Delimiter: delimiter in which CSV is configured.

  • CSV Has Reader: keep the option activated if the CSV to be transformed has a header in the beginning of the array.

  • Fail On Error: if the option is enabled, the execution of the pipeline with error will be interrupted; otherwise, the pipeline execution proceeds, but the result will show a false value for the “success” property.

Messages flow

Input

The component waits for a message with the property. You can provide the CSV data as an array of strings:

{
"data": ["HEADER1,HEADER2,HEADER3", "LINE1,LINE1,LINE1", ...]
}

or provide the CSV data as a single string:

{
"data": "LINE1,LINE1,LINE1"
}

Output

{
"data": [{"HEADER1": "LINE1",
"HEADER2": "LINE1",
"HEADER3": "LINE1"
},
{"HEADER1": "LINE2",
"HEADER2": "LINE2",
"HEADER3": "LINE2"
}, ....]
}

If you receive an unique string:

{        
"data": {"HEADER1": "LINE1",
"HEADER2": "LINE1",
"HEADER3": "LINE1"
}
}

Did this answer your question?