Pages

Tuesday, 18 July 2023

Bulk create Drive folders with subfolders

The following Google Apps Script is designed to bulk create Google Drive folders with multiple subfolders. You control the naming convention of each folder and exactly how many you want.

Use this tool to bulk create folders with subfolders
Use this tool to bulk create folders with subfolders

Features

  1. Runtime control - currently set to 5 minutes 30 seconds. Will ignore rows that have a 'Folder Link' so you can continue from where you left off and append further folders should you require.
  2. More subfolders - the Google Sheet has columns for 10 subfolders but you can technically add more (columns) and the code will account for this automatically.
  3. Toast popups to inform you of the progress as folders are created.
  4. 'Log' sheet and popup error messages if something goes wrong.
  5. Concatenation - create those useful descriptive folder/file names so items are easier to search for in the future. Concatenate will let you combine values that may exist in different columns in another spreadsheet for example, or take those folder names and prepend/append words around them. Concatenate guide webpage.



Download

Bulk create Drive folders with subfolders download (please use 'File' > 'Make a copy' for your own version).



3 comments:

  1. Phil, thank you for this tool! I used it in 2024 for a bulk creation of Google Drive folders with little difficulty. Now that we're in the new year, I'm trying to create 2025 subfolders under the existing structure. Unfortunately I've lost the original spreadsheet from 2024. When I attempt to run the script for these new folders, it creates a duplicate "Folder Name". Is there a way to have this script point to the already created folders to do this all at once, or would I need to update the parent folder ID to each individual existing folder?

    ReplyDelete
    Replies
    1. Thank you Mark!

      Unfortunately not. I completely understand what you're aiming to achieve but I don't yet have a tool that appends subfolders to existing folders.

      Complications arise around 'how' to get existing folder IDs into the Google Sheet for them to then be iterated through - if you do this manually then you save no time being in Drive and just creating the subfolders yourself. So then you could use something like Google Picker to point to a folder as long as they contain a single set of subfolders only and automatically extract them ... I have thoughts it's just putting them into practice and making it universal for the varying folder structures people will have.

      Delete
    2. Phil,

      Thank you for the response! I think what I'm going to do is use your script to create the '25 folders then go into Google Drive and move them to the correct place in the file tree so we keep all current and historical folders in the same place. If only Google had a way to merge folders...

      Thanks again for sharing the tool and your response.

      Delete