---
title: "Automating the creation of multiple folders in Google Drive with Google Apps Script (with a nice Google Sheet processing code pattern)"
author: "Martin Hawksey"
date: 2023-04-06T19:33:18+00:00
canonical_url: https://pulse.appsscript.info/p/2023/04/automating-the-creation-of-multiple-folders-in-google-drive-with-google-apps-script-with-a-nice-google-sheet-processing-code-pattern/
markdown_url: https://pulse.appsscript.info/p/2023/04/automating-the-creation-of-multiple-folders-in-google-drive-with-google-apps-script-with-a-nice-google-sheet-processing-code-pattern.md
categories:
  - "Drive"
  - "Intermediate"
  - "Sheets"
  - "Solutions"
tags:
  - "@labnol"
  - "labnol.org"
featured_image: https://pulse.appsscript.info/files/2023/03/QXV0b21hdGluZyB0aGUgQ3JlYXRpb24gb2YgTXVsdGlwbGUgRm9sZGVycyBpbiBHb29nbGUgRHJpdmU.waJ4X9Ei6-UzyasAuDd3ls2CBXBOowt12KgQB0OD8b8.png
description: "Whilst this post from Amit Agarwal looks at the automatic creation of Google Drive folders, it's also worth having a look at it at for an Apps Script pattern for iterating over and processing data from Google Sheets. In particular there is a getStudentData()function that turns the 2D array return from .getValues() into an object array which includes a rowIndex. This makes it easy to update your Google Sheet when each row is processed."
---

# Automating the creation of multiple folders in Google Drive with Google Apps Script (with a nice Google Sheet processing code pattern)

![Automating the creation of multiple folders in Google Drive with Google Apps Script (with a nice Google Sheet processing code pattern)](https://pulse.appsscript.info/files/2023/03/QXV0b21hdGluZyB0aGUgQ3JlYXRpb24gb2YgTXVsdGlwbGUgRm9sZGVycyBpbiBHb29nbGUgRHJpdmU.waJ4X9Ei6-UzyasAuDd3ls2CBXBOowt12KgQB0OD8b8.png)

[![](https://pulse.appsscript.info/files/2023/03/QXV0b21hdGluZyB0aGUgQ3JlYXRpb24gb2YgTXVsdGlwbGUgRm9sZGVycyBpbiBHb29nbGUgRHJpdmU.waJ4X9Ei6-UzyasAuDd3ls2CBXBOowt12KgQB0OD8b8-2.png)](https://www.labnol.org/create-bulk-folders-230327)

 

> you can use the following Apps Script to create folders in Google Drive for students and share those folders with their email addresses based on data from a Google Sheet

Whilst this post from Amit Agarwal looks at the automatic creation of Google Drive folders, it’s also worth having a look at it at for an Apps Script pattern for iterating over and processing data from Google Sheets. In particular there is a `getStudentData()`function that turns the 2D array return from `.getValues()` into an object array which includes a `rowIndex`. This makes it easy to update your Google Sheet when each row is processed.

Source: *[Automating the Creation of Multiple Folders in Google Drive – Digital Inspiration*](https://www.labnol.org/create-bulk-folders-230327)

---

*Published by [Martin Hawksey](https://pulse.appsscript.info/p/author/admin/) on [Pulse](https://pulse.appsscript.info/). Original article: [https://pulse.appsscript.info/p/2023/04/automating-the-creation-of-multiple-folders-in-google-drive-with-google-apps-script-with-a-nice-google-sheet-processing-code-pattern/](https://pulse.appsscript.info/p/2023/04/automating-the-creation-of-multiple-folders-in-google-drive-with-google-apps-script-with-a-nice-google-sheet-processing-code-pattern/)*
