The Challenge
I want to automate scanned expenses receipts.
The folder structure:
- expenses inbox
- 2020
- 1. Quarter
- 01_Jan
- 200105_expense.pdf
- 01_Jan
- 2. Quarter
- 3. Quarter
- 4. Quarter
- 1. 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.
A Proposed Solution
One way to tackle this is 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 — the Formatter can do this.
NOTE: You can use any format (Jan, January, 01, etc) as long as what your Formatter outputs matches the value in your lookup table. This will make more sense as you keep reading below.
In the image above, you’ll see that {{zap_meta_human_now}}
. This is to get the timestamp (more info) of when the Zap triggered, which you then want to format into just MM (this is what I meant in the note above).
Next, you’ll use that output in a lookup table, matching the month (the value on the left — 09 and 10 below) with the ID of the corresponding folder (the value on the right — the-long-ID-string-for-this-folder below).
TIP: You can get folder ID by clicking on the folder in Google Drive and copying the very last part of the URL — it should look something like 1UOslWD5txi82ST2eY7ffBxD_bOdfa0yN
.
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.
And finally, you would map the output of the lookup tables into the Google Drive step, using the Custom option instead of selecting a folder from the dropdown...
...then creating the title by combining the output of your Formatter step with some typed text:
Hopefully that helps some of y’all out!