fix(Google Sheets Node): Fix for append operation if no empty rows in sheet
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user