I’m trying to access the files within my Google Drive folder. I have the folder ID and using the following lines of code, but the folder returned is empty
var folderid = '1R07zv6TK9ka_BX--EMucP4pFlqYUsDJH';
var folder = DriveApp.getFolderById(folderid);
var files = folder.getFiles();
What would cause the getFolderById method to return null when the folderid is correct and I have access to said folder?
The folder ID is correct and it is a folder in My Drive
Folder ID in Google Drive
New contributor
Shankar Ramani is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.