Hi if you want to use sortRange in Google Sheets API you need a sheetId as an int not string. How can I get it starting with the sheets name as string
This works perfectly to sort my the sheet. But sheetId I had to set manually. sheetId: 959061457
try {
const request = {
spreadsheetId: spreadsheetId,
resource: {
requests: [{
sortRange: {
range: {
sheetId: 959061457,
startRowIndex: 1,
endRowIndex: 1000,
startColumnIndex: 0,
endColumnIndex: 6
},
sortSpecs: [{
sortOrder: 'DESCENDING',
dimensionIndex: 2
}]
}
}],
},
auth: client,
};
await sheets.spreadsheets.batchUpdate(request)
} catch (error) {
console.log(error)
}
Is there an option to get sheetId as a number from some api? It's in the URL but sadly batchUpdate, clear or append do not have it as an int in the response
I have the spreadsheet ID and the table name as sting.