fix(Google Sheets Node): Append fails if cells have some default values added by data validation rules (#9950)

This commit is contained in:
Michael Kret
2024-07-06 01:05:08 +03:00
committed by GitHub
parent b910ed6847
commit d1821eba92
7 changed files with 216 additions and 161 deletions

View File

@@ -202,10 +202,11 @@ export async function execute(
return [];
}
const { data, headerRow, firstDataRow } = prepareSheetData(
sheetData,
dataLocationOnSheetOptions,
);
const {
data,
headerRow: keyRowIndex,
firstDataRow: dataStartRowIndex,
} = prepareSheetData(sheetData, dataLocationOnSheetOptions);
let responseData = [];
@@ -215,6 +216,8 @@ export async function execute(
[],
) as ILookupValues[];
const inputData = data as string[][];
if (lookupValues.length) {
const returnAllMatches = options.returnAllMatches === 'returnAllMatches' ? true : false;
@@ -235,16 +238,16 @@ export async function execute(
| 'AND'
| 'OR';
responseData = await sheet.lookupValues(
data as string[][],
headerRow,
firstDataRow,
responseData = await sheet.lookupValues({
inputData,
keyRowIndex,
dataStartRowIndex,
lookupValues,
returnAllMatches,
combineFilters,
);
});
} else {
responseData = sheet.structureArrayDataByColumn(data as string[][], headerRow, firstDataRow);
responseData = sheet.structureArrayDataByColumn(inputData, keyRowIndex, dataStartRowIndex);
}
returnData.push(