Data Converter
Actions49
- Base64 Actions
- Binary Actions
- Encoding Actions
- Format Actions
- HTML Actions
- String Actions
Overview
The node converts JSON data into CSV format. It is useful when you need to transform structured JSON arrays or objects into a CSV string for use in spreadsheets, data exports, or integrations that require CSV input.
Typical scenarios include:
- Exporting API response JSON data as CSV files.
- Preparing JSON data for import into spreadsheet applications.
- Converting JSON logs or records into CSV for easier analysis.
For example, converting a JSON array of user objects into a CSV table with columns for name, email, and age.
Properties
| Name | Meaning |
|---|---|
| Input JSON | The JSON data to convert. This should be a valid JSON string representing an array or object. |
| CSV Delimiter | Character used to separate fields in the CSV output. Default is comma (,). |
| Include Headers | Whether to include the header row with field names in the CSV output. Options: true or false. |
| Binary Property Name | Name for the output binary property if outputting binary data (not typically used here). |
Output
The node outputs a JSON object with a single field containing the CSV string result. The CSV string represents the converted data from the input JSON according to the specified delimiter and header inclusion.
If configured to output binary data (not typical for this operation), the CSV content would be provided as a binary file under the specified binary property name.
Example output JSON structure:
{
"result": "name,email,age\nJohn,john@example.com,30\nJane,jane@example.com,25"
}
Dependencies
- No external services or API keys are required.
- The node uses internal utility functions for JSON to CSV conversion.
- No special environment variables or n8n configurations needed.
Troubleshooting
- Invalid JSON input: If the input JSON string is malformed or not parseable, the node will throw an error. Ensure the JSON is valid and properly formatted.
- Empty or non-array JSON: If the JSON does not represent an array or suitable object structure, the CSV output may be empty or incorrect.
- Delimiter issues: Using multi-character delimiters or special characters might cause unexpected CSV formatting.
- Headers missing: If "Include Headers" is set to false, the CSV will not have column names, which might confuse downstream systems expecting headers.
To resolve errors, verify the JSON input correctness and adjust delimiter and header settings accordingly.