mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user