Sheet Manager icon

Sheet Manager

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

Edit

AI-generated

Overview

This node operation edits an existing XLSX file by modifying a specific cell value in a specified sheet. It locates the row to modify based on an exact match in a condition column and updates the target column in that row with a new value. This is useful for workflows that need to update spreadsheet data dynamically, such as updating status, quantities, or other information in an Excel sheet based on certain conditions.

Use Case Examples

  1. Updating the status of an order in an Excel sheet where the order ID matches a given value.
  2. Changing the price of a product in a spreadsheet when the product code matches a specified condition.

Properties

Name Meaning
File (.xlsx) Path to the XLSX file. Relative to /data/sheet-manager if not absolute. Defaults to /tmp/data.xlsx.
Sheet Name of the sheet to process.
Condition Column Column used to locate the row to modify.
Condition Value Exact value to match in the condition column to find the row to edit.
Target Column Column where the new value will be written. Defaults to the condition column if left empty.
New Value New value to set in the target cell.

Output

JSON

  • success - Indicates if the edit operation was successful (true or false).
  • message - Descriptive message about the result of the edit operation, such as success confirmation or error details if the row or columns were not found.

Dependencies

  • Requires the 'exceljs' library for reading and writing XLSX files.
  • Requires file system access to read, write, and check existence of XLSX files.

Troubleshooting

  • Error if the specified XLSX file does not exist.
  • Error if the specified sheet does not exist in the file.
  • Error if the condition column or target column is not found in the sheet headers.
  • If no row matches the condition value in the condition column, the operation returns a failure message indicating no matching row was found.
  • File permission issues may prevent reading or writing the XLSX file.

Discussion