0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions108

Overview

This node provides a utility to convert CSV data into an array format. It is useful when you have CSV content as a string and want to transform it into a structured JavaScript array for further processing within your workflow. Common scenarios include parsing CSV exports from other systems, preparing CSV data for JSON conversion, or manipulating tabular data programmatically.

For example, if you receive a CSV string representing user data, this node can convert it into an array of rows, where each row is itself an array of column values. This makes it easier to iterate over the data or apply additional transformations.

Properties

Name Meaning
Code Variables A collection of code variables defined in the code editor that can be used within the function. Each variable has:
- Variable Name or ID: Select from existing code variables or specify an ID.
- Value: The value assigned to the variable.
CSV The CSV string input to be converted. This is the raw CSV content you want to parse.
Options Additional options for CSV parsing:
- Delimiter: Character used to separate columns (default ;). Leave empty to auto-detect.
- Trim CSV (omitFirstRow): Whether to omit the first row of the CSV file (boolean).

Output

The output is a JSON array where each item corresponds to one input item processed. For the "Convert a CSV to Array" operation, the output JSON contains the parsed CSV data represented as an array of arrays. Each inner array represents a row from the CSV, with its elements being the individual cell values.

If multiple input items are processed, the output will be an array of such arrays.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authentication with the external service powering the node.
  • The node sends requests to an external API endpoint corresponding to the resource "convert" and operation "csv/array".
  • No additional environment variables or configurations are explicitly required beyond the API key.

Troubleshooting

  • Common issues:

    • Incorrect delimiter: If the CSV delimiter does not match the actual delimiter in the CSV string, the output array may be malformed or contain unexpected results. Try specifying the correct delimiter or leave it empty for auto-detection.
    • Malformed CSV input: Invalid CSV formatting can cause parsing errors or incorrect output.
    • Omitting the first row: If the first row contains headers but the option to omit it is not set, the header row will appear as part of the output data.
  • Error messages:

    • Errors related to invalid CSV format or parsing failures may occur. Ensure the CSV string is well-formed.
    • Authentication errors if the API key credential is missing or invalid.
    • Network or API errors if the external service is unreachable.

Resolving these typically involves verifying the CSV input, adjusting delimiter and omit-first-row options, and ensuring valid API credentials.

Links and References

Discussion