Sheet Manager icon

Sheet Manager

Create, update, or delete XLSX files within your n8n workflows.

Create or Append

AI-generated

Overview

This node operation creates or appends data to an XLSX file. It is useful for workflows that need to generate or update Excel spreadsheets dynamically, such as exporting data reports, logging information, or aggregating data from various sources. For example, you can create a new Excel file with custom headers and data or append new rows to an existing file without overwriting the existing content.

Use Case Examples

  1. Creating a new Excel file with specified headers and data objects.
  2. Appending rows to an existing Excel file while preserving existing data.

Properties

Name Meaning
File (.xlsx) Path to the XLSX file. Relative to /data/sheet-manager if not absolute. Defaults to /tmp/data.xlsx.
File Name Optional. If provided, overrides the file name from the path. For example: "my_file.xlsx".
Sheet Name of the sheet to process.
Append Mode Whether to append data if the file already exists instead of overwriting it.
Custom Headers Optional. If omitted, headers will be inferred from the input data.
Default Value for Empty Fields Value to use when a property is missing in a data object. Use "null" to leave it empty.
JSON Data Array of objects to insert. Example: [{ "col1": "val1" }, ...].

Output

JSON

  • success - Indicates if the file was successfully created or appended.
  • message - Status message about the file operation.

Dependencies

  • exceljs library for XLSX file manipulation
  • Node.js fs and path modules for file system operations

Troubleshooting

  • Ensure the file path is correct and writable, especially relative paths under /data/sheet-manager.
  • The JSON data must be a valid array of objects; invalid JSON or non-array input will cause errors.
  • If append mode is enabled but the file or sheet does not exist, a new file or sheet will be created.
  • Custom headers must be valid strings; otherwise, headers will be inferred from data keys.
  • Permission issues may arise when writing or deleting files; verify folder permissions.

Discussion