I have a spreadsheet bound google apps script and I would like to use the doGet function to control the spreadsheet/mail sending from the outside. Basically a user gets a mail onFormSubmit with two links (I'm trying with the dev version of my code):
https://script.google.com/a/macros/..mydomain.../s/...myID.../dev?line=6&answer=ok
https://script.google.com/a/macros/..mydomain.../s/...myID.../dev?line=6&answer=no
The function is the following:
function doGet(e){
var sp = PropertiesService.getScriptProperties();
var ssId = sp.getProperty('thisSpreadsheet');
var sheetName = sp.getProperty('richiestaFerieSheetName');
Logger.log(ssId + ' ' + sheetName)
var ss = SpreadsheetApp.openById(ssId);
Logger.log(ss + ' ' + ss.getName());
var foglioRichiestaFerie = ss.getSheetByName(sheetName);
foglioRichiestaFerie.setActiveRange((foglioRichiestaFerie.getRange(e.parameter.line, 1)));
handleRequest(e.parameter.answer=='ok' ? true : false, false);
}
But I get the TypeError mentioned in the title.
The log correctly shows ssId, sheetName, ss and ss.getName(), so I can't understand why the getSheetByName method is not working properly.
Any hint?
Thanks for your attention!


getSheetByName? - taylorc93ssand the line that gets the sheet by name, and see what happens. - Alan Wells