Reputation: 7
This is what I'm using, I've also tried switching DriveApp for SpreadsheetApp with the same error. Any ideas?
var spreadsheetname = playerarray[i] + " Prisoner's Dilemma Individual Sheet";
var newspreadsheet = SpreadsheetApp.create(spreadsheetname);
spreadsheetlinks.push(DriveApp.getUrl(newspreadsheet));
spreadsheetlinks.push(DriveApp.getId(newspreadsheet));
Upvotes: 0
Views: 202
Reputation: 50774
Like the error says, the function getUrl
is not available in DriveApp
. It is available on classes file
and Spreadsheet
. Fortunately, SpreadsheetApp.create
returns a spreadsheet
.
var spreadsheetname/* type: string*/ = playerarray[i] + " Prisoner's Dilemma Individual Sheet";
var newspreadsheet /* type: spreadsheet*/= SpreadsheetApp.create(spreadsheetname);
/*pushing string type into array type*/
spreadsheetlinks.push(newspreadsheet.getUrl());//getUrl available on spreadsheet type
Upvotes: 2