Open GoogleCodeExporter opened 9 years ago
[deleted comment]
Workaround:
in google apps script: "var driveid = file.getId();" gives the long
spreadsheet key that is in the URL
var ss = SpreadsheetApp.create("Test");
var id = ss.getId();
Logger.log(id)
// get the ss file through Drive using spreadsheet id
var file = DriveApp.getFileById(id);
var driveid = file.getId();
Logger.log(driveid)
// open the spreadsheet using id of file
var ssfromdrive = SpreadsheetApp.openById(driveid);
Logger.log(ssfromdrive.getName())
http://stackoverflow.com/questions/21842456/get-the-spreadsheet-key-that-is-in-t
he-url-not-ss-getid
Original comment by InstantW...@gmail.com
on 3 Mar 2014 at 11:58
This "workaround" doesn't avoid the "manual process" that the OP wanted to
avoid. In the example's case, you are getting the ID from a .create method,
but what about files that already exist? It seems now you have to first
retrieve the user's list of spreadsheet files, and then parse out the key from
that list. Is there a "best" practice for retrieving the key of a google
spreadsheet?
Original comment by dr.aries...@gmail.com
on 23 Apr 2014 at 1:44
Original issue reported on code.google.com by
InstantW...@gmail.com
on 17 Feb 2014 at 7:18