Data Converter
Actions49
- Base64 Actions
- Binary Actions
- Encoding Actions
- Format Actions
- HTML Actions
- String Actions
Overview
The node converts data from CSV format to JSON format. It parses CSV input text into a JSON array, where each row becomes an object with keys derived from the CSV headers (if included). This operation is useful when you receive or work with CSV data and need to process it as structured JSON within your workflow.
Common scenarios include:
- Importing CSV data from files or APIs and converting it for further processing.
- Transforming tabular CSV data into JSON objects for database insertion or API calls.
- Automating data ingestion pipelines that require JSON format.
Example: Converting a CSV string like:
name,age,city
Alice,30,New York
Bob,25,Los Angeles
to JSON:
[
{"name": "Alice", "age": "30", "city": "New York"},
{"name": "Bob", "age": "25", "city": "Los Angeles"}
]
Properties
| Name | Meaning |
|---|---|
| Input Data | The CSV text data to convert. |
| CSV Delimiter | Character used to separate fields in the CSV. Default is comma (,). |
| Include Headers | Whether the first row contains headers to use as JSON object keys (true or false). |
Output
The output is a JSON array representing the parsed CSV rows. Each element in the array is an object with key-value pairs corresponding to CSV columns and their values.
If the CSV includes headers, those headers become the keys of each JSON object. If headers are excluded, the output will be an array of arrays or objects with default keys depending on the underlying parsing logic.
No binary output is produced by this operation.
Example output structure:
[
{
"column1": "value1",
"column2": "value2"
},
{
"column1": "value3",
"column2": "value4"
}
]
Dependencies
- No external services or API keys are required.
- The node uses internal utility functions for CSV parsing.
- No special environment variables or n8n configurations are needed.
Troubleshooting
- Incorrect delimiter: If the CSV delimiter does not match the actual delimiter in the input data, parsing will fail or produce incorrect results. Ensure the delimiter matches the CSV format.
- Headers mismatch: If "Include Headers" is set incorrectly, the output keys may be wrong or missing. Set it to
trueif the first row contains column names; otherwise, set tofalse. - Malformed CSV: Improperly formatted CSV (e.g., unescaped quotes, inconsistent columns) can cause parsing errors.
- Empty input: Providing empty or whitespace-only input will result in empty output or errors.
Common error messages:
- Parsing errors related to CSV format issues.
- Missing required parameter "Input Data".
To resolve errors:
- Verify CSV formatting and delimiter.
- Check property settings for headers.
- Provide valid CSV input.