How to List Files in a Folder and Subfolder on Google Drive

Google Drive has lots of prebuilt tools that can be used to modify, create and edit files. However, there’s no app or tool to display the contents of a folder or a subfolder. In general, while you are viewing Google Drive, you can see the list of all files already on it. But the same cannot be said or done for the different folders and subfolders. So, we did our research and came across certain methods to make it happen.

The method will involve using Google Script for the same. It isn’t as difficult as it may sound. We have tried it ourselves and written down all you need to know. Hence, in this article, we will learn how to use Google Apps Script to create a list of all the files and folders on your Drive and their links. 

How to List Files in a Folder and Subfolder on Google Drive?

There are a couple of scripts that you can find online and paste into the Google Apps Script editor to get a list of files inside a folder.

However, we have created a detailed explanation using the method we found works the best. Refer to the instructions given below to see how to do it. 

  • Open your laptop or PC and load your preferred browser. 
  • Head over to the Google Drive website at drive.google.com
  • Enter your details to access the Drive. 
  • Once you’re logged in, hover over to the side menu and click on the New button on top of it. 
  • Select Google Sheets and click on Blank spreadsheet from the menu. 
  • When the blank spreadsheet opens up, head over to the toolbar and click on Extensions, and select Apps script from the menu. 
  • A new tab will open up with the Google Apps Script editor and delete everything from the main body of the script. 
  • Head over to this website, copy the code they have written and paste it into the script editor. 
  • After pasting it, click on the Save icon on the toolbar. 
  • Once the script is saved, click on the Run button next to the Save icon on the toolbar. 
  • This will check the code and then tell you to review the permissions as this script accesses your files in Drive. Click on Review permissions.
  • Choose the account you want, click on Advanced, and select the Go to button at the bottom with “unsafe” written next. 
  • Next, head back to the same Google Sheets page you used to open this script editor and refresh it. 
  • Once refreshed, you will see an option labeled “List File/Folders” in the toolbar. Click on it and choose List All Files and Folders from the menu. 
  • A new dialog box will be displayed on the screen where you have to enter the folder ID of the folder whose files you want to be listed. 
  • To get the ID of a folder, head over to the main Google Drive webpage and find and open the folder you’re looking for. 
  • When you open the folder, copy the random string of letters from the address bar right after the forward slash in the web address, as shown in the example,  “https://drive.google.com/drive/u/0/folders/”. 
  • Paste the folder ID in the Google Sheets tab’s pop-up box and click on OK. 

All of your files should begin listing automatically on the spreadsheet, and depending on the number of files and subfolders, it may take a couple of minutes for all of them to be displayed. 

All the files in that folder will be listed according to their full path within the Drive, name, type, date of creation, link, last updated, size, and the owner’s email address. 

List Files in a Folder and Subfolder on Google Drive
List Files in a Folder and Subfolder on Google Drive

Read How to Search Large Files on Google Drive

How to Highlight Files or Folders in Google Drive?

You can highlight specific files and folders in Google Drive to help you find them quickly later on. It also enables you to access the file much more easily if it is something you use on a regular basis.

Refer to the instructions given below to learn how to highlight files in Google Drive. 

  • Open your laptop or PC and load your preferred browser. 
  • Head over to the Google Drive website at drive.google.com
  • Enter your details to access the Drive. 
  • Once you’re logged in, select and file or folder you want and draw out the contextual menu by right-clicking on it. 
  • Select Add to starred from the menu. The file will now be added to the Starred section in your Drive, which you can access by using the side menu. 

Read How to Make Files Public on Google Drive

How to Download a Google Sheets File as a PDF

You can easily convert a Google Sheets file to a PDF and download it using the toolbar in Google Sheets. Refer to the steps provided below to learn how to do that. 

  • Open your laptop or PC and load your preferred browser. 
  • Head over to the Google Drive website at drive.google.com
  • Enter your details to access the Drive. 
  • Once logged in, click the New button on top of the side menu and select Google Sheets from it. 
  • You can also use a previously made Google Sheets document. 
  • Click on File in the Google Sheets toolbar and choose Download.
  • Select PDF from the menu, and your download should commence shortly. 

Read How to Download Google Drive Files on iPad

Conclusion

That’s it, folks. We hope this article helped you figure out how to create a list of files inside a folder on Google Drive. You do not need any prior coding knowledge to execute this method. Just follow the steps, and you should be good. 

It might be possible that you can encounter errors while working on Google Scripts, but you can restart over and follow the same steps as mentioned and that should be enough to help you out. Other than this, we have also mentioned the steps that will eventually help you to download Google Sheets as a PDF file to share it with other users who may or may not be on Google drive.

You may like the following google drive tutorials: