Best answer

Automating my Daily Archiving of files in Google Drive

  • 12 June 2020
  • 3 replies
  • 745 views

Userlevel 1

Workflow

  1. I have a Folder that a program generates files every hour.
  2. We need to keep these files and will organize them by date
  3. Each Day we create a folder for the day and drag the days items into the folder
  4. Each Month we put all day folders into a month folder.

Zapier Help

 

We have Created a Zap that generates a new folder every day at midnite

  1. How do we move new files into the daily folder (keeping in mind that the folder is a different one daily)?
  2. How Can we move the months worth of files into the month folder at the end of the month?

 

icon

Best answer by nicksimard 1 September 2020, 17:49

View original

3 replies

Userlevel 7
Badge +11

Hi @Metin!

I think the way to do this that would require the least amount of work would be to use a Lookup Table (more info) to output the proper folder, depending which month the Zap is triggering in, then you can use a Formatter step to get you the YYMMDD format, which you can use as the title of the PDF.

The tricky thing about lookup tables is that the incoming value has to be an exact match, so you’ll need the date to show you just the month (in which way you want, whether it Jan, January, 01 or whatever) — the Formatter can do this. 

Above, you’ll see that {{zap_meta_human_now}}. This is to get the timestamp of when the Zap triggered, which you then want to format into just MM. Next, you’ll use that output in a lookup table, matching the month with the ID of the corresponding folder (you can get that by clicking on the folder in Google Drive and copying the very last part of the URL — should look something like 1UOslWD5txi82ST2eY7ffBxD_bOdfa0yN.

And finally, you would map the output of the lookup table into the Google Drive step, using the Custom option instead of selecting a folder from the dropdown:

Then for the file name, you would do something similar to what I showed above, to get you MM. Except this time you’ll format to YYMMDD. Whew! Hopefully that makes sense!

EDIT

I elaborated a bit on this method for one of our Workflow Wednesday articles. Check it out if you’re looking for more details!

Userlevel 1

@nicksimard I’m very interested in the workflow you described of moving files into an existing folder month. I want to automate scanned expenses receipts.

The folder structure:

  • expenses inbox
  • 2020
    • 1. Quarter
      • 01_Jan
        • 200105_expense.pdf
    • 2. Quarter
    • 3. Quarter
    • 4. Quarter

My desired workflow:

  • The file with the naming structure YYMMDD_expense.pdf gets added to the expenses inbox folder.
  • A zap would look for the right Year, Quarter and Month and move that file into that folder.

I’m not sure how to tackle this automation. Any advice?

Userlevel 7
Badge +11

Hi @Birch!

That’s quite a workflow challenge you’ve got there :) I’ve tackled something similar in the past so I think I can help with the daily folder part, but I wanted to ask a couple of things first.

  1. Where do the files go into every hour? Is it always the same folder (like /program-name/files for example)?
  2. At what time of the day would you want to move the files from that folder into the daily folder, or would it matter if it was right away?

The Google Drive integration doesn’t yet support the moving of folders, so we won’t be able to automate the moving of all those daily folders into the monthly one. BUT, what we could do is to also create the files inside of a daily folder that is housed within the monthly folder.

Example:

  • file gets added to the program folder
  • you make a copy of the file, to add into a month/day folder (like June/16)
  • you then move it from programs into the day folder
  • at the end of the month you could delete all of the day folders that don’t live within the month folder (since you will already have placed copies there)

OR…

Can you just create the day folders within a month folder right from the start, rather than somewhere else and then moving them there?

It’s not a perfect solution. The alternative would be to not automate the moving of folders into the monthly folder and just do that part manually. It’s putting all of the daily files into folders that probably takes the most time, I imagine.

Reply