fix(Google Sheets Trigger Node): Support sheet names with non-latin characters (#6970)

Github issue / Community forum post (link here to close automatically):
https://community.n8n.io/t/how-to-get-new-rows-in-google-sheets/25810
This commit is contained in:
Marcus 2023-08-18 14:38:41 +02:00 committed by GitHub
parent b6a00febbd
commit 052dd7cc9d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -418,7 +418,7 @@ export class GoogleSheetsTrigger implements INodeType {
}
const googleSheet = new GoogleSheet(documentId, this);
const sheetName = await googleSheet.spreadsheetGetSheetNameById(sheetId);
const sheetName: string = await googleSheet.spreadsheetGetSheetNameById(sheetId);
const options = this.getNodeParameter('options') as IDataObject;
const previousRevision = workflowStaticData.lastRevision as number;
@ -510,7 +510,7 @@ export class GoogleSheetsTrigger implements INodeType {
(await apiRequest.call(
this,
'GET',
`/v4/spreadsheets/${documentId}/values/${sheetName}!${keyRange}`,
`/v4/spreadsheets/${documentId}/values/${encodeURIComponent(sheetName)}!${keyRange}`,
)) as IDataObject
).values as string[][]) || [[]];
@ -596,7 +596,7 @@ export class GoogleSheetsTrigger implements INodeType {
const previousRevisionSheetData =
sheetBinaryToArrayOfArrays(
previousRevisionBinaryData,
sheetName as string,
sheetName,
rangeDefinition === 'specifyRangeA1' ? range : undefined,
) || [];