Tuesday 18 February 2020

Bulk create test folders/files in Google Drive

The following Google Apps Script is designed to bulk create a set number of Google Drive folder/files as quickly as possible. Its purpose was to support a bigger project I was working on with bulk moving folders/files from My Drive to Shared Drive.
Screenshot of example folder structure in Google Drive
Screenshot of example folder structure in Google Drive

The script makes use of 4 'loops' with the option to define how many folders/files you want to create at each level. There is an initial top row of folders each with files, then a row of sub-folders under this each with files too.

Selecting to create 5 of each via the parameters would produce 175 items in total, within about 8 minutes.

Bulk create test folders/files in Google Drive

4 comments:

  1. Hi - where did the project to move/copy files from MyDrive to Shared Drives?
    We have the same problem as many I guess, too many files in MyDrive and they need to be in Shared Drives. Any thoughts and solutions welcomed

    ReplyDelete
    Replies
    1. Hi Richard

      I'm afraid that's not a project I've got. I've played around with a few prototypes but never had anything I'm happy to release.

      Kind regards
      Phil

      Delete
  2. Hi Phil,
    I would like to bulk create folders in a shared drive, with 3 subfolders in each. I kind of need this: https://www.pbainbridge.co.uk/2021/05/bulk-create-google-drive-folders-with.html with an extra 2 subfolders. How can I edit the scrip and matching sheets template to do this?
    Thanks for everything you've shared!

    ReplyDelete
    Replies
    1. Hi

      Thank you.

      Yes you're going to need to create some extra columns for each of the subfolders. Then it's a matter of working with some loops to go through these extra columns (it's perfectly feasible, but requires some careful planning/thought about how to do the iterating). I can't really point at a specific line of code to just change as it needs more code writing/inserting.

      Kind regards
      Phil

      Delete