Skip to content

Instantly share code, notes, and snippets.

View ErikLentz's full-sized avatar

Erik Lentz ErikLentz

View GitHub Profile
@ErikLentz
ErikLentz / GoogleDrive-ListDriveContents.gs
Last active March 29, 2024 21:34
Google Drive - List folders and contents into a Google Sheet using Apps Script
// Create a Google Sheet, click Extensions > Apps Script, enter the code in this script, and fill in the Folder ID variable
// Folder ID can be found at the end of the folder URL, i.e. https://drive.google.com/drive/folders/FOLDER_ID_HERE
var folderId = 'ENTER FOLDER ID HERE';
function main() {
var SS = SpreadsheetApp.getActiveSpreadsheet();
//Uncomment and modify next line if you want to output to a particular tab on your sheet
//var sh0 = SS.getSheetByName("YOUR SHEET NAME HERE");
var ui = SpreadsheetApp.getUi(); //Comment this line if you use the above modification
getFolderTree(folderId, true);

Keybase proof

I hereby claim:

  • I am eriklentz on github.
  • I am smeg (https://keybase.io/smeg) on keybase.
  • I have a public key ASDRe58lreSNeQs2S5fAfbZ5PePG21M-u1juITdhB09A0go

To claim this, I am signing this object: