fix(Google Sheets Node): Return single row in read operation if combine conditions is OR and 'Return only First Matching Row' (#15095)

This commit is contained in:
Michael Kret
2025-05-06 20:32:00 +03:00
committed by GitHub
parent d0022c5700
commit e0f5ba2c67
6 changed files with 61 additions and 18 deletions

View File

@@ -651,12 +651,14 @@ export class GoogleSheet {
dataStartRowIndex,
lookupValues,
returnAllMatches,
nodeVersion,
combineFilters = 'OR',
}: {
inputData: string[][];
keyRowIndex: number;
dataStartRowIndex: number;
lookupValues: ILookupValues[];
nodeVersion: number;
returnAllMatches?: boolean;
combineFilters?: 'AND' | 'OR';
}): Promise<IDataObject[]> {
@@ -672,7 +674,7 @@ export class GoogleSheet {
keys.push(inputData[keyRowIndex][columnIndex] || `col_${columnIndex}`);
}
// Standardise values array, if rows is [[]], map it to [['']] (Keep the columns into consideration)
// Standardize values array, if rows is [[]], map it to [['']] (Keep the columns into consideration)
for (let rowIndex = 0; rowIndex < inputData?.length; rowIndex++) {
if (inputData[rowIndex].length === 0) {
for (let i = 0; i < keys.length; i++) {
@@ -718,6 +720,9 @@ export class GoogleSheet {
}
if (returnAllMatches !== true) {
if (nodeVersion >= 4.6) {
break lookupLoop;
}
continue lookupLoop;
}
}