Last active
April 21, 2023 06:03
-
-
Save EnricoPicci/e3fd10ef230eabe5428db823f0079457 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function listDocsInFolder() { | |
var folderId = '########' // folder id that can be retrived from the url of the Google Drive folder | |
var folder = DriveApp.getFolderById(folderId); | |
var files = folder.getFiles(); | |
var fileDetails = [] | |
while (files.hasNext()){ | |
file = files.next(); | |
fileDetails.push({id:file.getId(), name: file.getName()}) | |
} | |
var jsonFiles = JSON.stringify(fileDetails, null, 2) | |
Logger.log('File details:\n %s', jsonFiles); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment