Tuesday, 29 March 2022

Search Google Drive folders for creation/modified dates

The following Google Apps Script is designed to search through one level of Google Drive folders and extract the following information into a Google Sheet:

  • The folder name as a direct clickable link,
  • The folder creation date,
  • The folder last updated date,
  • The folder ID.
Enter the Parent folder ID and search the folders within
Enter the Parent folder ID and search the folders within

The tool is based on the foundation of the Search Google Drive for owned files blog post in terms of the code used. The difference here is that we use the DriveApp to get the Parent folder and then iterate through all of the folders within it:

var parentFolder = DriveApp.getFolderById('FOLDER ID HERE').getFolders();


Instructions

Please follow the guidance on the 'Welcome' sheet to provide the ID of the parent folder which contains the relevant folders you need to scan. Use the 'Start' button to run the tool. The 'Folders' tab in the Google Sheet is where the information will be collated.

There is a 'Reset sheet' option in the 'Admin' menu to clear the Google Sheet if you wish to re-run it on a different folder.

The 'Log' sheet is to help debug any problems and you will receive a popup message to also inform you of any problems the tool encounters.


Caveats

The tool is designed to work with one level of folders, it will not go into sub-sub-folders. This is due to the significant amount of time it would take for the tool to run if there were hundreds of folders within folders, etc:

Only one level of folders will be scanned
Only one level of folders will be scanned

Download

Search Google Drive folders for creation/modified dates download (please use 'File' > 'Make a copy' for your own version).


No comments:

Post a Comment