Excel Form Writer
AI-generatedOverview
This node, named Excel Form Writer, writes data to specific cells in an Excel template file and saves the modified file to a specified output path. It is useful for automating the process of filling out Excel forms or templates with dynamic data, such as generating personalized reports, invoices, or data sheets based on input values.
Use Case Examples
- Filling an Excel invoice template with customer details and amounts.
- Populating a report template with calculated metrics before saving it as a new file.
Properties
| Name | Meaning |
|---|---|
| Template File Path | The absolute path to the Excel template file to be used as the base for writing data. |
| Output File Path | The absolute path where the new Excel file with the written data will be saved. |
| Cell Data (JSON) | A JSON array of objects specifying which cells to write to and the values to write. Each object must have 'cell' (e.g., 'B7') and 'value' keys. |
| If File Exists | Determines the action if the output file already exists: overwrite the file, throw an error, or rename the new file to avoid overwriting. |
Output
JSON
message- Status message indicating success or error.path- The file path where the new Excel file was saved.error- Error message if the operation failed and continueOnFail is enabled.
Dependencies
- exceljs library for reading and writing Excel files
- Node.js fs and path modules for file system operations
Troubleshooting
- Ensure the template file path is correct and the file exists; otherwise, a 'Template file not found' error is thrown.
- Validate that the Cell Data is a valid JSON array; invalid JSON will cause an error.
- If the output file exists and the 'If File Exists' option is set to 'error', the node will throw an error.
- Permissions issues when reading the template or writing the output file can cause failures.