14

After searching, the closest information I've found is this question. However, that answer covers just creating a Google Drive file, period. I would like to find out how to make that file get created in a specific folder.

Is this possible?

5

I watched what happens when Google Docs creates a new document in a folder. The browser briefly goes to a create url. To make the url, you need to know your folder's id. If you navigate to the folder in a browser, its id is at the end of the url:

https://drive.google.com/drive/u/0/folders/[string_of_characters_is_the_folder_id]

Copy the id, open a new browser tab, and paste the id onto the end of the create url, like so:

https://docs.google.com/document/create?usp=drive_web&folder=[string_of_characters_is_the_folder_id]

Press Enter, and the browser will go to your new document created in the folder identified in the url.

| improve this answer | |
  • 3
    Next step in this journey is to create a file FROM A TEMPLATE and have it created INSIDE OF A SPECIFIC FOLDER... once that is complete I will attain cosmic awareness... lol. Thank you so much... – randomblink Jan 24 '16 at 16:52
  • Is it fair to say that a document using a template is essentially a copy of a certain document? I mean I don't see a difference between a template-based document and a copy-based document. – jaycer Jan 26 '16 at 14:52
  • Mind. Blown. Of course. Thank you. Now I can generate templated work forms for my co-workers and provide links from Trello that will generate copies in the folders where they need to go... this is perfection. – randomblink Jan 26 '16 at 18:02
  • 1
    randomblink, I want what you describe, but I can't make the leap from jaycer's hint to your insight. How do you construct a URL that creates a new copy-based document that goes to a particular folder? – jml Apr 4 '17 at 10:48
  • 1
    Agreed, has anyone managed to figure out what the command is? – midasmax Oct 13 '17 at 10:03
5

I know this thread has been quiet for a while, but it helped me.

I was able to accomplish this by:

  1. getting the URL of the destination folder https://drive.google.com/drive/folders/[Folder ID]

  2. taking the file's url

  3. replacing /edit with /copy
  4. adding the copyDestination param to the end

Original URL:

https://docs.google.com/[specific file URL]/edit

Final result would look like this:

https://docs.google.com/[specific file URL]/copy?copyDestination=[Folder ID]

I hope this helps!

| improve this answer | |
  • shame I can only upvote this answer once – ericslaw Jul 26 '19 at 19:59
  • Is this still working for people? I'm getting Not Found Error 404. – Nathan Lloyd May 4 at 16:30
1

To follow on to the questions in comments on the answer from @jaycer :

How do you create a file from a template inside a specific folder

The URL would look like this

https://docs.google.com/document/d/${temlpateId}/copy?id=${temlpateId}&copyCollaborators=false&copyComments=false&includeResolvedCommentsOnCopy=false&title=${title}&copyDestination=${folderId}&usp=docs_web

Substituting these values :

  • ${temlpateId} : The ID of the source file/template. You can get this from the URL when you browse to the source file/template. Note that the value shows up twice in the URL
  • ${title} : The name to give the new file
  • ${folderId} : The ID of the folder to put the new file in. This comes from the URL when you browse to the Google Drive folder.
| improve this answer | |
-1

New Document: https://docs.google.com/document/create?usp=drive_web&folder=[folder-id]

New Spreadsheet: https://docs.google.com/spreadsheets/create?usp=drive_web&folder=[folder-id]

| improve this answer | |
-2

Hmm, i just thought: actually it should be fairly easy to create a script, so that you can make a google doc by just right clicking in windows explorer. Would be insanely helpful as an alternative, if you're not using word and don't want to use the browser all the time.

| improve this answer | |
  • I am aware this wasn't really an answer, although I don't have the reputation to comment, that's why and I thought it might be interesting for someone ;( – John Copperhand Jun 24 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.