UNPKG

@nerme/n8n-nodes-converter-documents-xlsx

Version:

Enhanced n8n document converter with flexible sheet processing. Converts DOCX, XML, YML, XLS, XLSX, CSV, PDF, TXT, PPT, PPTX, HTML, JSON, ODT, ODP, ODS to JSON/text. Features individual sheet workflow items, toggleable metadata, Excel row/column preservat

52 lines (43 loc) 2.11 kB
// Test to verify the final n8n array format fix console.log('Testing n8n array format fix - Version 1.1.8...'); console.log('\n=== Issue Analysis ==='); console.log('Persistent error: outputData.entries is not a function'); console.log('Problem: n8n expects specific array nesting structure'); console.log('\n=== Format Comparison ==='); console.log('\n--- Working Grouped Output Format ---'); const workingFormat = [[{ json: { files: [{ sheets: { Sheet1: { data: [...] } } }], totalFiles: 1, processedAt: "2025-01-04T12:00:00.000Z" } }]]; console.log('return [[{json: {...}}]]; // Array of arrays'); console.log('\n--- Previous Broken Format (v1.1.7) ---'); const brokenFormat = [ { json: { fileName: "file.xlsx", rows: [...] } }, { json: { fileName: "file.xlsx", rows: [...] } } ]; console.log('return separateItems; // Direct array - BROKEN'); console.log('\n--- Fixed Format (v1.1.8) ---'); const fixedFormat = [[ { json: { fileName: "file.xlsx", sheetName: "Sheet1", rows: [...] } }, { json: { fileName: "file.xlsx", sheetName: "Sheet2", rows: [...] } } ]]; console.log('return [separateItems]; // Array containing array - FIXED'); console.log('\n=== Key Insight ==='); console.log('n8n expects: [array_of_items] not array_of_items'); console.log('Both modes must return the same structure:'); console.log('- Grouped: [[single_item_with_all_data]]'); console.log('- Separate: [[item1, item2, item3, ...]]'); console.log('\n=== Final Code Change ==='); console.log('Before: return separateItems;'); console.log('After: return [separateItems];'); console.log('Result: Matches working grouped output structure exactly'); console.log('\n=== Expected Behavior ==='); console.log('✅ No more "outputData.entries is not a function" error'); console.log('✅ Each sheet becomes separate workflow item'); console.log('✅ Proper n8n workflow execution'); console.log('✅ Compatible with n8n v1.113.3'); console.log('\n=== Version 1.1.8 Ready ==='); console.log('This should be the final fix for the n8n compatibility issue.');