Reputation: 53
var idRisultati = DriveApp.getFileById(ssNew.getId()).moveTo(DriveApp.getFolderById(idCartellaEsame));
var ssNeww = SpreadsheetApp.openById(idRisultati.getId());
The "move to" operation works fine and the file appears in the desired folder, but IdRisultati contains only the name of the new file created. How can I obtain the new file Id?
Upvotes: 0
Views: 46
Reputation: 64100
Try it this way:
const file = DriveApp.getFileById(ssNew.getId()).moveTo(DriveApp.getFolderById(idCartellaEsame));
var ssNeww = SpreadsheetApp.openById(file.getId());
Upvotes: 1