Tuesday, 2 November 2021

Bulk create Google Drive Folders and add Files 2.0

The following Google Apps Script tool was developed to bulk create Google Drive folders with optional files copied in to each one, all from data within a Google Sheet, along with the ability to adjust all folder/file names used.

It is a variation of this Bulk create Google Drive Folders and add Files tool post.

Bulk create Google Drive folders with optional files, from a Google Sheet
Bulk create Google Drive folders with optional files, from a Google Sheet

Key Functionality

  1. Maximum runtime - in order to prevent the tool from reaching the limits imposed by Google you can adjust the number of minutes the tool can run for. Change this in the 'GlobalVariables.gs' file in the Script Editor.
  2. Continue from where it left off - if you have a lot of Google folders and files to handle and the above runtime is reached the tool will complete the current row/folder and prompt you to run it again, without duplicating any folders or files already created.
  3. Popups - as well as the 'Log' sheet the tool displays a direct popup to the user if it encounters a problem.
  4. Full naming control - you have the ability to tweak every single folder and file name that is created by the tool. See the Concatenate section below to understand the true power of this.
  5. Clickable links - created by the tool which means you can navigate directly to the new folders and files directly from the Google Sheet.
  6. Add more files - the tool currently has columns for 10 files to be added to each folder, but you can actually append more as long as you follow the same convention of 2 columns per file (1 file name and 1 file ID). Do this before you run the tool as you cannot add more files to a folder once it has been created.
  7. Add more folders - after running the tool you can either choose to clear all of the data within it (use the 'Reset sheets' option from the 'Admin' menu) and start again or you can simply append further rows/folders and re-run without any duplication (if the 'Folder Link' column is not blank/empty then it will skip that row).

 

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 here.


Instructions

  1. Follow the instructions on the 'Welcome' sheet to help you setup the tool as you require. You will need to enter the ID of the Google/Shared Drive folder where you want the new folders to be created under. A folder ID is the last part of the Url eg https://drive.google.com/drive/folders/this_bit_is_the_ID.
  2. Next you will need to go to the 'Folders' sheet and provide the names for the folders you want to create (1 row per folder). Leave the 'Folder Link' column empty. Also add the names and IDs of any files you wish to copy into the new folders. A file ID is typically the long string of random letters/numbers of the Url eg for a Google Doc: https://docs.google.com/document/d/this_bit_is_the_ID/edit.
  3. To run the tool either click the 'Start now' button on the 'Welcome' sheet or use the 'Admin' menu and select 'Create folders' (they both achieve the same goal). The first time you run the tool you will need to authorise access to your Google account and then select to run it again.



Download

Bulk create Google Drive Folders and add Files 2.0 download here (please use 'File' > 'Make a copy' for your own version).


2 comments:

  1. just wondering if can add "Email Address(es) for Permissions" function to this template? THX

    ReplyDelete
    Replies
    1. Hi Kai

      In theory 'yes'. I did start work on a version to do that but it became quite comprehensive trying to lay it out in a universal format for people to use. If I ever do complete it then I'll be sure to post it on the blog.

      Kind regards
      Phil

      Delete