fix(Google Sheets Node): Append exceeding grid limits (#7684)
Github issue / Community forum post (link here to close automatically): https://community.n8n.io/t/error-appending-data-with-google-sheets/28691
This commit is contained in:
@@ -191,6 +191,14 @@ export const description: SheetProperties = [
|
||||
...handlingExtraData,
|
||||
displayOptions: { show: { '/columns.mappingMode': ['autoMapInputData'] } },
|
||||
},
|
||||
{
|
||||
displayName: 'Use Append',
|
||||
name: 'useAppend',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description:
|
||||
'Whether to use append instead of update(default), this is more efficient but in some cases data might be misaligned',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
@@ -228,17 +236,28 @@ export async function execute(
|
||||
|
||||
if (setData.length === 0) {
|
||||
return [];
|
||||
} else if (options.useAppend) {
|
||||
await sheet.appendSheetData(
|
||||
setData,
|
||||
sheetName,
|
||||
headerRow,
|
||||
(options.cellFormat as ValueInputOption) || cellFormatDefault(nodeVersion),
|
||||
false,
|
||||
undefined,
|
||||
undefined,
|
||||
options.useAppend as boolean,
|
||||
);
|
||||
} else {
|
||||
await sheet.appendEmptyRowsOrColumns(sheetId, 1, 0);
|
||||
}
|
||||
|
||||
await sheet.appendSheetData(
|
||||
setData,
|
||||
sheetName,
|
||||
headerRow,
|
||||
(options.cellFormat as ValueInputOption) || cellFormatDefault(nodeVersion),
|
||||
false,
|
||||
);
|
||||
await sheet.appendSheetData(
|
||||
setData,
|
||||
sheetName,
|
||||
headerRow,
|
||||
(options.cellFormat as ValueInputOption) || cellFormatDefault(nodeVersion),
|
||||
false,
|
||||
);
|
||||
}
|
||||
|
||||
if (nodeVersion < 4 || dataMode === 'autoMapInputData') {
|
||||
return items;
|
||||
|
||||
Reference in New Issue
Block a user