diff --git a/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts b/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts index 293cea5414333..da0befd1fbe9a 100644 --- a/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts +++ b/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts @@ -11,7 +11,7 @@ export class GoogleSheets extends VersionedNodeType { name: 'googleSheets', icon: 'file:googleSheets.svg', group: ['input', 'output'], - defaultVersion: 4.4, + defaultVersion: 4.5, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: 'Read, update and write data to Google Sheets', }; @@ -25,6 +25,7 @@ export class GoogleSheets extends VersionedNodeType { 4.2: new GoogleSheetsV2(baseDescription), 4.3: new GoogleSheetsV2(baseDescription), 4.4: new GoogleSheetsV2(baseDescription), + 4.5: new GoogleSheetsV2(baseDescription), }; super(nodeVersions, baseDescription); diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/read.operation.ts b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/read.operation.ts index 5f87c8baa523c..8f8959a4639c6 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/read.operation.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/read.operation.ts @@ -135,6 +135,19 @@ export const description: SheetProperties = [ options: [ dataLocationOnSheet, outputFormatting, + { + displayName: 'Return only First Matching Row', + name: 'returnFirstMatch', + type: 'boolean', + default: false, + description: + 'Whether to select the first row of the sheet or the first matching row (if filters are set)', + displayOptions: { + show: { + '@version': [{ _cnd: { gte: 4.5 } }], + }, + }, + }, { displayName: 'When Filter Has Multiple Matches', name: 'returnAllMatches', @@ -154,6 +167,11 @@ export const description: SheetProperties = [ ], description: 'By default only the first result gets returned, Set to "Return All Matches" to get multiple matches', + displayOptions: { + show: { + '@version': [{ _cnd: { lt: 4.5 } }], + }, + }, }, ], }, @@ -219,7 +237,12 @@ export async function execute( const inputData = data as string[][]; if (lookupValues.length) { - const returnAllMatches = options.returnAllMatches === 'returnAllMatches' ? true : false; + let returnAllMatches; + if (nodeVersion < 4.5) { + returnAllMatches = options.returnAllMatches === 'returnAllMatches' ? true : false; + } else { + returnAllMatches = options.returnFirstMatch ? false : true; + } if (nodeVersion <= 4.1) { for (let i = 1; i < items.length; i++) { diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/actions/versionDescription.ts b/packages/nodes-base/nodes/Google/Sheet/v2/actions/versionDescription.ts index 66c47905cbae9..ebaa2e40ba1ba 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/actions/versionDescription.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/actions/versionDescription.ts @@ -9,7 +9,7 @@ export const versionDescription: INodeTypeDescription = { name: 'googleSheets', icon: 'file:googleSheets.svg', group: ['input', 'output'], - version: [3, 4, 4.1, 4.2, 4.3, 4.4], + version: [3, 4, 4.1, 4.2, 4.3, 4.4, 4.5], subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: 'Read, update and write data to Google Sheets', defaults: {