mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
⚡ Minor fix on Spreadsheet File
This commit is contained in:
parent
43fae950e6
commit
abe1ee144a
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"node": "n8n-nodes-base.spreadsheetFile",
|
"node": "n8n-nodes-base.spreadsheetFile",
|
||||||
"nodeVersion": "1.1",
|
"nodeVersion": "1.0",
|
||||||
"codexVersion": "1.1",
|
"codexVersion": "1.0",
|
||||||
"categories": [
|
"categories": [
|
||||||
"Data & Storage",
|
"Data & Storage",
|
||||||
"Core Nodes"
|
"Core Nodes"
|
||||||
|
@ -20,4 +20,4 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -207,6 +207,20 @@ export class SpreadsheetFile implements INodeType {
|
||||||
default: '',
|
default: '',
|
||||||
description: 'File name to set in binary data. By default will "spreadsheet.<fileFormat>" be used.',
|
description: 'File name to set in binary data. By default will "spreadsheet.<fileFormat>" be used.',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
displayName: 'Header Row',
|
||||||
|
name: 'headerRow',
|
||||||
|
type: 'boolean',
|
||||||
|
displayOptions: {
|
||||||
|
show: {
|
||||||
|
'/operation': [
|
||||||
|
'fromFile',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
default: true,
|
||||||
|
description: 'The first row of the file contains the header names.',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Include Empty Cells',
|
displayName: 'Include Empty Cells',
|
||||||
name: 'includeEmptyCells',
|
name: 'includeEmptyCells',
|
||||||
|
@ -296,20 +310,6 @@ export class SpreadsheetFile implements INodeType {
|
||||||
default: 'Sheet',
|
default: 'Sheet',
|
||||||
description: 'Name of the sheet to create in the spreadsheet.',
|
description: 'Name of the sheet to create in the spreadsheet.',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
displayName: 'Header Row',
|
|
||||||
name: 'headerRow',
|
|
||||||
type: 'boolean',
|
|
||||||
displayOptions: {
|
|
||||||
show: {
|
|
||||||
'/operation': [
|
|
||||||
'fromFile',
|
|
||||||
],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
default: true,
|
|
||||||
description: 'Consider the first row as the header row or a data row.',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -373,7 +373,7 @@ export class SpreadsheetFile implements INodeType {
|
||||||
if (options.includeEmptyCells) {
|
if (options.includeEmptyCells) {
|
||||||
sheetToJsonOptions.defval = '';
|
sheetToJsonOptions.defval = '';
|
||||||
}
|
}
|
||||||
if (!options.headerRow) {
|
if (options.headerRow === false) {
|
||||||
sheetToJsonOptions.header = 1; // Consider the first row as a data row
|
sheetToJsonOptions.header = 1; // Consider the first row as a data row
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,15 +385,15 @@ export class SpreadsheetFile implements INodeType {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add all the found data columns to the workflow data
|
// Add all the found data columns to the workflow data
|
||||||
if (options.headerRow) {
|
if (options.headerRow === false) {
|
||||||
for (const rowData of sheetJson) {
|
|
||||||
newItems.push({ json: rowData } as INodeExecutionData);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// Data was returned as an array - https://github.com/SheetJS/sheetjs#json
|
// Data was returned as an array - https://github.com/SheetJS/sheetjs#json
|
||||||
for (const rowData of sheetJson) {
|
for (const rowData of sheetJson) {
|
||||||
newItems.push({ json: { row: rowData } } as INodeExecutionData);
|
newItems.push({ json: { row: rowData } } as INodeExecutionData);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (const rowData of sheetJson) {
|
||||||
|
newItems.push({ json: rowData } as INodeExecutionData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue