I'm trying to save all the responses of a Google Form file (with an onSumbmit(e) function, based on a trigger) to a newly created spreadsheet, based on a template. Unfortunately my script stops working at this point:
var ID = "I put here the ID of the file template";
var ss = SpreadsheetApp.open(DriveApp.getFileById(ID)); <-- Here it stopped
ss.copy(name+"_"+date);
I really don't know why, but the scripts seems unable to open the template file and make a copy. I've also tried with a getFileByUrl, SpreadsheetApp.openById(ID) and SpreadsheetApp.openByUrl(URL), but nothing change!
I receive this error: You do not have permission to call openById
I've read here that maybe it's a policy change of Google but it's over 2 years ago. Maybe I'm doing something wrong?
Thanks to all!
SpreadsheetApp.openById(ID)
? Documentation – CasperSpreadsheetApp.openById(id)
– Alan Wells