mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
feat(Google Sheets Node): Add "By Name" option to selector for Sheets (#8241)
Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
@@ -12,7 +12,7 @@ import { apiRequest } from './v2/transport';
|
||||
import { sheetsSearch, spreadSheetsSearch } from './v2/methods/listSearch';
|
||||
import { GoogleSheet } from './v2/helpers/GoogleSheet';
|
||||
import { getSheetHeaderRowAndSkipEmpty } from './v2/methods/loadOptions';
|
||||
import type { ValueRenderOption } from './v2/helpers/GoogleSheets.types';
|
||||
import type { ResourceLocator, ValueRenderOption } from './v2/helpers/GoogleSheets.types';
|
||||
|
||||
import {
|
||||
arrayOfArraysToJson,
|
||||
@@ -399,11 +399,21 @@ export class GoogleSheetsTrigger implements INodeType {
|
||||
extractValue: true,
|
||||
}) as string;
|
||||
|
||||
let sheetId = this.getNodeParameter('sheetName', undefined, {
|
||||
const sheetWithinDocument = this.getNodeParameter('sheetName', undefined, {
|
||||
extractValue: true,
|
||||
}) as string;
|
||||
const { mode: sheetMode } = this.getNodeParameter('sheetName', 0) as {
|
||||
mode: ResourceLocator;
|
||||
};
|
||||
|
||||
sheetId = sheetId === 'gid=0' ? '0' : sheetId;
|
||||
const googleSheet = new GoogleSheet(documentId, this);
|
||||
const { sheetId, title: sheetName } = await googleSheet.spreadsheetGetSheet(
|
||||
this.getNode(),
|
||||
sheetMode,
|
||||
sheetWithinDocument,
|
||||
);
|
||||
|
||||
const options = this.getNodeParameter('options') as IDataObject;
|
||||
|
||||
// If the documentId or sheetId changed, reset the workflow static data
|
||||
if (
|
||||
@@ -417,13 +427,6 @@ export class GoogleSheetsTrigger implements INodeType {
|
||||
workflowStaticData.lastIndexChecked = undefined;
|
||||
}
|
||||
|
||||
const googleSheet = new GoogleSheet(documentId, this);
|
||||
const sheetName: string = await googleSheet.spreadsheetGetSheetNameById(
|
||||
this.getNode(),
|
||||
sheetId,
|
||||
);
|
||||
const options = this.getNodeParameter('options') as IDataObject;
|
||||
|
||||
const previousRevision = workflowStaticData.lastRevision as number;
|
||||
const previousRevisionLink = workflowStaticData.lastRevisionLink as string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user