Skip to content

Commit

Permalink
fix(Google Sheets Trigger Node): Support sheet names with non-latin c…
Browse files Browse the repository at this point in the history
…haracters (#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
  • Loading branch information
maspio authored Aug 18, 2023
1 parent b6a00fe commit 052dd7c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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[][]) || [[]];

Expand Down Expand Up @@ -596,7 +596,7 @@ export class GoogleSheetsTrigger implements INodeType {
const previousRevisionSheetData =
sheetBinaryToArrayOfArrays(
previousRevisionBinaryData,
sheetName as string,
sheetName,
rangeDefinition === 'specifyRangeA1' ? range : undefined,
) || [];

Expand Down

0 comments on commit 052dd7c

Please sign in to comment.