This is my test function:
var testFolderId = 'di98kjsdf9...';
function testGetFolder(testFolderId){
folder = DriveApp.getFolderById(testFolderId);
Logger.log("folders: " + folder);
}
It fails when I do this. The error says: INVALID ARGUMENT
However, if I hardcode the id into the 'DriveApp.getFolderById' function, it works.
Any explanation? This makes no sense to me.