1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

files → Convert a CSV to Array of Objects

AI-generated

Overview

This node provides a function to convert a CSV file into an array of objects. It is particularly useful when you need to process or analyze tabular data within your n8n workflows, such as importing contact lists, transaction records, or any structured data stored in CSV format. The node supports customization for header row detection and dynamic typing, making it flexible for various CSV formats.

Practical examples:

  • Importing user data from a CSV export into a CRM.
  • Parsing product inventories for further automation.
  • Converting survey results into structured JSON for analysis.

Properties

Name Meaning
CSV file Could be a comma or tab separated file format. This is the input CSV data to be converted.
First row is header If true, the first row of the data will be interpreted as field names for the result. Default is true. Set to false if your CSV does not have headers.
Use dynamic typing If true, numeric and boolean data will be converted to their type instead of remaining strings. Numeric data must conform to the definition of a decimal literal. Numerical values greater than 2^53 or less than -2^53 will not be converted to numbers to preserve precision. Decimal delimiter has to be a '.'. Default is true.

Output

The output is a JSON array where each element represents a row from the CSV file, mapped as an object with key-value pairs:

[
  {
    "column1": "value1",
    "column2": 123,
    "column3": true
  },
  {
    "column1": "value2",
    "column2": 456,
    "column3": false
  }
]
  • Each object corresponds to a row in the CSV.
  • Keys are determined by the header row (if enabled) or default column names.
  • Values are automatically typed if "Use dynamic typing" is enabled.

Dependencies

  • External Service: Requires access to the 1001fx API.
  • API Key: You must configure the 1001fxApi credential in n8n.
  • Environment: No additional environment variables required beyond standard n8n setup.

Troubleshooting

Common Issues:

  • Invalid CSV Format: Malformed CSV files may cause parsing errors. Ensure your file uses consistent delimiters and quoting.
  • Missing Headers: If "First row is header" is set incorrectly, the output keys may not match expectations.
  • Type Conversion Errors: If "Use dynamic typing" is enabled but the data contains non-standard number formats, some fields may remain as strings.

Error Messages:

  • "error": "Unexpected token ...": Indicates invalid JSON returned, likely due to malformed CSV or server error.
  • "error": "Request failed with status code 401": Check your API credentials.
  • "error": "File not found": Ensure the correct binary property is referenced.

Links and References

Discussion