0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions132

Convert → Convert CSV to JSON

AI-generated

Overview

The node provides a utility to convert CSV data into JSON format. This is useful when you have tabular data in CSV form and want to transform it into structured JSON objects for further processing, integration, or analysis within an n8n workflow.

Common scenarios include:

  • Importing CSV exports from spreadsheets or databases and converting them to JSON for API consumption.
  • Processing CSV data received from external sources and transforming it into JSON for easier manipulation.
  • Automating data transformation pipelines where CSV files are a common input format.

For example, you might use this node to convert a CSV list of users with columns like "Name", "Age", and "City" into an array of JSON objects representing each user.

Properties

Name Meaning
CSV Data The raw CSV string data to be converted into JSON format. Example: Name,Age,City\nJohn,30,New York\nJane,25,London
Separator The character used to separate fields in the CSV data. Common separators include comma (,), semicolon (;), or pipe (`

Output

The node outputs a JSON array where each element corresponds to a row in the CSV input, with keys derived from the CSV header row and values from each subsequent row.

Example output JSON structure:

[
  {
    "Name": "John",
    "Age": "30",
    "City": "New York"
  },
  {
    "Name": "Jane",
    "Age": "25",
    "City": "London"
  }
]

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential to authenticate requests to the external service at https://prod.0codekit.com.
  • The node sends a POST request to the /convert/csvtojson endpoint with the CSV data and separator as payload.
  • Ensure that the API key credential is configured correctly in n8n to allow successful communication.

Troubleshooting

  • Empty or malformed CSV input: If the CSV data is empty or incorrectly formatted, the conversion may fail or produce unexpected results. Verify the CSV string includes a valid header row and consistent field counts per row.
  • Incorrect separator: Using the wrong separator character can cause parsing errors or incorrect JSON output. Confirm the separator matches the delimiter used in your CSV data.
  • API authentication errors: If the API key credential is missing or invalid, the node will fail to connect to the service. Check that the credential is set up properly.
  • Network issues: Connectivity problems to the external API endpoint will prevent conversion. Ensure network access to https://prod.0codekit.com is available.

Links and References

Discussion