Home » Google » Google Drive: Create a Table of Contents for a Folder

Google Drive: Create a Table of Contents for a Folder

List the Files in a Google Drive Folder

I’ve been on a coding binge 🙂 I saw that an AP Biology group were sharing lesson plans and resources in a Google Drive folder with a lot of subfolders to organize by topics. I thought it might be helpful to share the folder with a table of contents so I coded a way to grab each file in the folder(s) and list them.


Add-ons menu make list of files
  1. In a new tab go to alicekeeler.com/listthefiles
  2. Choose to copy the file.
  3. Wait about 1 minute for the code to load.
  4. Use the Add-on menu to choose “List the Files”
  5. You will need to authorize the code by clicking on “Advanced” and “Unsafe.” (It’s safe, I personally coded it.) You are only authorizing YOURSELF access to your files and Drive. You copied the code so now you are the owner of the code.
  6. Click the button to choose a folder in your Google Drive.
  7. You are selecting the FOLDER so single click on the folder and select.
  8. You may need to refresh, it can take a few minutes depending on how many files are being listed to fully generate the list.
  9. Format the resulting spreadsheet as desired.

Folder Tabs

If you do not have subfolders in your Google Drive folder you will end up with a list of all the files in the selected folder. Format this into a useable table of contents. Reorder the files and add comments as desired. If you have subfolders in the parent folder each of those sub folders will be represented in it’s own tab.

(note: the code only goes one layer deep of folders. If you have folders in the folders those were not picked up)

Format the Sheets

The alicekeeler.com/listthefiles just gives you a list of the files with the link to the file in the spreadsheet. You can now format the spreadsheet as desired to make it a useable table of contents. I have added checkboxes next to each file… mostly because I have a love affair with spreadsheet checkboxes. You can remove the checkboxes and perhaps number the files in the order you would like them to be accessed for your table of contents. Make columns wider, set word wrap, add a column for comments. Do whatever you want! It is your spreadsheet and editing the spreadsheet does not affect the files in Drive at all.

Try a Macro

If you have a lot of subfolders then you would probably want to format each subfolder tab the same way. Use the Tools menu in Google Sheets to use a Macro to record the steps of you formatting one page of the spreadsheet. Go back to the Tools menu to access your saved Macro to apply it to all of the other sheets in the spreadsheet.

Save the Spreadsheet in the Drive Folder

If you set up the spreadsheet as a table of contents guide to the folder you may want to rename the spreadsheet to “00 TABLE OF CONTENTS” and add it to the folder. This way when anyone accesses the folder they will alphabetically (hence the 00) see the table of contents first!

The spreadsheet does NOT automatically update. You would need to create a brand new alicekeeler.com/listthefiles if additional files are added. You could delete most of the tabs in the spreadsheet and run the add-on again to update the same spreadsheet. This would also allow you to use your Macro to format the update quickly.

Share the Spreadsheet

If the purpose of your Google Drive folder is to share resources then you may want to consider sharing the spreadsheet instead of the folder link. This way you can add a sheet with some directions or notes on how the shared folder works and the spreadsheet acts as a more organized way of accessing the files.

7 thoughts on “Google Drive: Create a Table of Contents for a Folder”

  1. I could not get it to load. It kept asking for permission for the script, which I kept hitting allow! It would take me back to the same place. It says A script attached to this document needs your permission to run.
    Continue. I hit continue and advanced, and allow and it brings me back to this

  2. This was working wonderfully for me, and now all of a sudden the List the File step just doesn’t load at all, no matter how long I wait, how many times I refresh, and regardless of which browser I use.
    Any tips on fixing this?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.