Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8264277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:23:53+00:00 2026-06-08T04:23:53+00:00

I’m attempting to use Google Docs’ ability to run scripts to create the necessary

  • 0

I’m attempting to use Google Docs’ ability to run scripts to create the necessary folder structure for new clients (to upload content/images into). Here’s what I have thusfar:

/**
 * This script creates the necessary folder structure for a new client
 */
function newClientSetup() {

  var initial = DocsList.getFolder("Clients");
  var client = DocsList.addtoFolder.createFolder("Client Name");
  var file = DocsList.addtoFolder(client);

};

Now this is not working (TypeError: Cannot call method "createFolder" of undefined. (line 7)), but I’m having trouble figuring out how to use the Folder class within DocList. I saw that DocsList has a createFolder method, that I could use like:

var folder = DocsList.createFolder("Folder Name");

but I’m trying to start off with a parent folder, called Clients (already in Google Docs) and then create the following structure:

Clients
    Client Name
        Content
        Images

Ideally I could run this script, but pass in a variable for Client Name to actually create the client name, but I haven’t found much help from the docs. Any suggestions? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:23:55+00:00Added an answer on June 8, 2026 at 4:23 am

    Here is an example of how it works, see comments :

    function createSubFolder(subfolder) { // the argument is the name of the folder you want to create
        var parentfolder = DocsList.getFolder('Clients'); //begin in the client folder (you could also open by Id, I prefer the ID as I find it more failsafe (ID are unique, names aren't necessarily 
        var newFolder = DocsList.createFolder(subfolder); // create the new subfolder from the argument of the function
        newFolder.addToFolder(parentfolder);// add the newly created folder to 'Clients'
    }   
    

    to test this function simply use something like this :

    function test(){
        createSubFolder('test');// this will create a new folder called test in your Clients folder
    }
    

    note : to get the ID of your folder, take the value right behind folders/ in the url of the folder. Example in bold : https://drive.google.com/?hl=fr&tab=wo#folders/0B3qSFxxxxxxxxxdsMTFZMDQ

    The sequence might be much longer if you have more folder levels… but the structure is always the same and is unique for every folder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use html5's new tag to play a wav file (currently only supported
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I am using Paperclip to handle profile photo uploads in my app. They upload

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.