RVS Spreadsheet File

Reads and writes data from a spreadsheet file like CSV, XLS, ODS, etc

Overview

This node, named "RVS Spreadsheet File," enables reading and writing spreadsheet files in various formats such as CSV, XLS, XLSX, ODS, HTML, and RTF. It supports three main operations:

  • Read Sheet Names: Extracts the names of all sheets present in a spreadsheet file.
  • Read From File: Reads data from a specified sheet within a spreadsheet file and outputs it as JSON.
  • Write to File: Converts workflow JSON data into a spreadsheet file in the chosen format.

This node is useful when you need to process spreadsheet files within an automation workflow, for example:

  • Extracting sheet names to dynamically select which sheet to process next.
  • Parsing spreadsheet data into JSON for further processing or integration.
  • Generating spreadsheet files from workflow data to export reports or datasets.

Properties

Name Meaning
Binary Property Name of the binary property containing the spreadsheet file's binary data to read from (for input).
Output Property Name of the property where each sheet name will be output (used in "Read Sheet Names" operation).
Operation The action to perform: "Read Sheet Names", "Read From File", or "Write to File".
File Format Format to save the spreadsheet file as (CSV, HTML, ODS, RTF, XLS, XLSX) (used in "Write to File").
Options Collection of additional options depending on the operation:
- Compression Whether to apply compression when writing XLSX or ODS files.
- File Name Custom file name for the output spreadsheet file. Defaults to "spreadsheet.".
- Header Row Whether the first row contains header names (affects parsing and writing).
- Include Empty Cells When reading, whether empty cells should be included as empty strings in JSON output.
- RAW Data Whether to return raw unparsed data instead of parsed JSON when reading.
- Read As String Force reading cell values as strings to avoid misinterpretation of special characters.
- Range Range of cells to read, either as a starting row number or A1-style range string.
- Sheet Name Name of the sheet to read from or write to. If not set when reading, defaults to the first sheet.

Output

  • For Read Sheet Names: Outputs multiple items, each with a JSON object containing one sheet name under the user-defined output property.

    Example:

    {
      "SheetName": "Sheet1"
    }
    
  • For Read From File: Outputs JSON objects representing rows from the selected sheet. If headerRow is true, keys are column headers; otherwise, rows are output as arrays or objects keyed by row index.

  • For Write to File: Outputs a single item with binary data containing the generated spreadsheet file in the specified format. The binary property name is user-configurable.

Dependencies

  • Uses the external library xlsx for reading and writing spreadsheet files.
  • Requires input data to contain binary spreadsheet files accessible via a specified binary property.
  • No explicit external API or service dependencies.
  • Requires proper configuration of binary data handling in n8n workflows.

Troubleshooting

  • Error: "Spreadsheet does not have any sheets!"
    Occurs if the input file is empty or corrupted. Verify the input binary data is a valid spreadsheet file.

  • Error: "Spreadsheet does not contain sheet called ..."
    Happens if the specified sheet name does not exist in the file. Check the sheet name spelling or use "Read Sheet Names" operation to list available sheets.

  • Empty output or no data
    Could be due to incorrect binary property name or missing binary data in input. Ensure the binary property matches the actual input data.

  • Special characters misinterpreted
    Enable the "Read As String" option when reading files to prevent character encoding issues.

  • File format unsupported or output file corrupt
    Confirm that the chosen file format is supported and consistent with the input data structure.

Links and References

Discussion