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 9300093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:42:24+00:00 2026-06-18T22:42:24+00:00

In my script I have template docs in the main drive, but when the

  • 0

In my script I have template docs in the main drive, but when the copy is created and populated with my excel data, I want it to be saved in a folder in drive. I have the script do that, but it has one copy of the file in the Main Google Drive, and the other in the folder I want it in. If I delete one of the copies, it deletes both.

Is there any way I can have it save automatically in the specified folder without also being in the main drive folder?

  • 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-18T22:42:25+00:00Added an answer on June 18, 2026 at 10:42 pm

    Folders in Google drive are not exactly like forders in a computer : having the file in your ‘root’ folder and in another folder doesn’t mean there are 2 files, but rather 1 and only file with 2 labels… that’s why you can’t delete one without deleting the other !

    The solution is simply to play with these labels in the script, here is how it works : (I commented each step to make it clear.)

    function othertest(){
    folder=DocsList.createFolder("MyFolder"); // or getFolderById or whatever other way to get your target folder
    var file=DocsList.createFile('File2', 'Empty');// just an empty file for test but this would be your file copy that you want to "move"
    file.addToFolder(folder);// put it in the folder
    file.removeFromFolder(DocsList.getRootFolder());// and remove from the root
    }
    

    The other possible solution is to create the file directly in the target folder since the folder object supports the createFile method. (Not sure though that you can do it in your specific use case)

    here is an example, you can see that the file is not in the root folder.

    function createFileinFoldertest() {
       var folder = DocsList.getFolder('test')
       folder.createFile('Empty test fileName','nothing in there')
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following KnockoutJS template (render with jquery.tmpl): <script id=contactsTemplate type=text/html> <li data-bind=click:
I have a template file I want to copy and then edit from a
I have a template like this: <script id=notesTemplate type=text/html> <li class=Note> <div class=NoteDate data-bind=style:
I have a template: <script type=text/template id=action-template-item> <span data-layer=<%= target%> data-uuid=<%= uuid%>>delete</span> </script> I
Hallo I have this script: <? require(lib2/config.inc.php); require(lib2/tpl.class.php); require(lib2/db.class.php); require(lib2/um.class.php); $tpl = new template(templates,
I have the following in my page, ready to: <div id=result></div> <script id=some-template type=text/x-handlebars-template>
I have a batch file containing a python script using the Output template> %(NAME)s
I have a simple template that loops over a ember-data model. Inside the loop
I have a jquery template setup like this: <script id='tmpl-video_list' type='text/x-jquery-tmpl'> <li> <a href='${url}'><br/>
I want to emit some js from jQuery templates e.g I have template like

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.