fix(Google Sheets Node): Fix for append operation if no empty rows in sheet

This commit is contained in:
Michael Kret
2022-12-01 10:39:03 +02:00
committed by GitHub
parent 6d4e959884
commit 741c7da8b1
8 changed files with 211 additions and 171 deletions

View File

@@ -154,6 +154,7 @@ export async function execute(
this: IExecuteFunctions,
sheet: GoogleSheet,
sheetName: string,
sheetId: string,
): Promise<INodeExecutionData[]> {
const items = this.getInputData();
const dataMode = this.getNodeParameter('dataMode', 0) as string;
@@ -176,6 +177,12 @@ export async function execute(
setData = mapFields.call(this, items.length);
}
if (setData.length === 0) {
return [];
} else {
await sheet.appendEmptyRowsOrColumns(sheetId, 1, 0);
}
await sheet.appendSheetData(
setData,
sheetName,