Best answer

Move/copy all contents from existing folder into new folder?

  • 28 December 2020
  • 4 replies
  • 619 views

Userlevel 1
Badge
  • Beginner
  • 16 replies

As a work-around for not being able to move existing folders, I’m wondering if it would  be possible to move/copy all of the contents from the already existing folder into a newly created folder?

For example - let’s say you have a client folder called “CLIENT NAME” in a parent folder called “CLIENTS”. But let’s say they stop being a client and you now want to create a new folder called “OLD-CLIENT NAME” in the existing folder called “EX CLIENTS”, and then move/copy all of the contents from folder “CLIENT NAME”  into folder “OLD-CLIENT NAME” 

So, for example, every time the trigger happens (ie offboarding form):

1) a new folder is created: “OLD-CLIENT NAME” within another parent folder that already exists (ie “EX-CLIENTS”)

2) files in the existing previous client folder are found (ie all files in folder named “CLIENT NAME”) 

3) and then all files in the folder CLIENT NAME are moved/copied into the newly created folder “OLD-CLIENT NAME”, within the existing parent folder “EX CLIENTS”

Is something like this possible? If so, what would be the steps in zapier?

Thanks so much!

icon

Best answer by nicksimard 28 December 2020, 23:53

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

Userlevel 7
Badge +14

GDrive Files can be copied, but only one at a time, so you’d have to create some sort of looping Zap to iterate thru all the files, which is much more technical to configure.

 

Userlevel 1
Badge

Well, rather than a “looping action”, I’m hoping for some sort of action that finds every file that's named in a specific way and then creates a copy of it in another folder that also gets created with the trigger. 

So if every single folder and every single file is named in the same naming format, and the only difference is the “client name" part of the folder/file, it seems like Zapier could figure it out? 

For example (the info in the squiggly lines being the name of the client on the original spreadsheet that triggers the action, and the only variable in the naming of each file/folder):

  1. Trigger: spreadsheet row with {{clientname}} gets updated
  2. Create new subfolder called “OLD-{{clientname}}”, within existing parent folder “EX CLIENTS”
  3. Find existing subfolder named {{clientname}} in parent folder CLIENTS. 
  4. Find document in that subfolder, named “{{clientname}}infosheet.doc” and create a copy of it in newly created folder OLD-{{clientname}} 
  5. find document called “{{clientname}}spreadsheet.xls” in folder “{{clientname}}”, and make copy of it into new folder OLD-{{clientname}}”, within existing folder called “EX CLIENTS”

So basically Zapier finding documents that always have the same format, only difference being the “client name” in each one, and then moving them into the new folder. Does that at all make sense? 

I just don’t know if this is at all possible in Zapier?

Userlevel 7
Badge +11

Hi @HGW!

This sounds like it might be possible, but the difficult part will come if there are multiple files within these folders, since the search steps only return one file. If you have standard files, like a single Google Doc and a single Google Sheet, you could possibly create separate steps for these. In this case, your best bet will honestly be to try it out, I’d say.

Here’s an important tip. When you’re doing some sort of search then want to act upon that item, you’ll use the Custom option and select (typically) the ID. Like this:

When using custom, it’s not a way to add something like a file name structure. It has to match what you see here (under my orange lines) when you use the dropdown option:

You can usually tell whether it’s the right thing based on the pattern of that text. Like if you saw something like…

1D-FjkNdSIJrLCsdKqmaS__41WNaYWAVPWy23I_iQLo

… under the file name, and you selected the Custom option, you’d know not to select something that looks like 35678 because it’s a wildly different pattern for an ID. That’s why it’s important to properly test that search step. Otherwise you’ll get the dummy text like 123456 and it’s not as clear whether you’re using the right field.

There’s more information about custom values in our help docs :)

Userlevel 1
Badge

Thanks Nick. I did in fact figure out how to move one document. Now I guess is to try to move multiple and/or decide if it’s really worth it lol. Thanks for your help, I will look into it more!