Create New Folders in Google Drive for Rows in Google Sheets
With Document Studio, you can create new empty folders in Google Drive for every new row in a Google Spreadsheet.
For instance, you may have a list of customers in a Google Sheet and you want to create a new folder for each customer, if one doesn't exist already. The company's HR may want to create separate folders for each employee in the organization. In addition to creating folders, you can also share the folder with your customers and employees using Google Drive.
For this example, we have the employee records in a Google Sheet with the employee name, department and the employee's email address. We would like to create a new folder in Drive for each employee, using the path /Department/Employee Name
, and then share the folder with the employee itself so that they can access it as an editor.
Create Folders with Google Drive
Install the Document Studio add-on and open your Google Sheet to launch the add-on. You may either open an existing Google Sheet or create a new sheet and add data in one or more rows of the sheet.
Inside the Document Studio app, provide a descriptive name for your workflow and choose the specific worksheet in your Google Spreadsheet that contains the merge data. Click on Continue
to move to the conditions page.
Add Conditions
Inside the Conditions section, specify if you want your workflow to run only if the row data satisfies certain conditions. For instance, you may only wish to create folders for employees in the IT and Legal department.
Next, choose Google Drive
from the list of available tasks.
Configure Google Drive Service
Choose Create Folder
as the Drive Service and select the parent folder in Drive where you would like to create the new folder. The folder may be in your personal Google Drive or a Shared Drive folder.
Next, specify the name of the new folder with the folder structure. For instance, if you want to create a folder for each employee in the IT department, you would specify /{{Department}}/{{Employee Name}}
.
You may also put the email address question in the Editor
section to automatically share the folder with the respondent.
Preview and Save
Click the Preview
button and you should see a new folder in your Google Drive created using data from the first row in the Google Sheet. Click Done
to locally apply your changes.
Click on Continue
to proceed to the triggers screen. If you want the workflow to be automatically triggered every hour, so that any new rows added in that duration are processed automatically, you can choose the option Run workflow every hour
and then click on the Save
button.
The workflow will now appear in the workflow dashboard where you can edit, delete or manually run the workflow.
If you would like to create multiple folders in Google Drive for a single row in your Google Sheet, you can add multiple Google Drive
tasks in the same workflow with the Create folder
service.