-
My goal is to get specific files from Google Drive to download as attachments to an email based on a google form input that is saved to an airtable.
-
The flow goes from Google Form Submission → Airtable → Router(just in case I need to split this) → search Google Drive(query for file - this is plaintext) → download file from Google Drive → Array Aggregator(to upload multiple files to an email) → send email
-
My thoughts are that the query in the search in the Google Drive should dynamically change.
-
Right now it is set to example because in the google drive folder the files are saved [NAME]-example.pdf
-
The Airtable looks something like this. The number of options can increase so there would be more than 3 files.
-
I want to attach to the email the files based on the option selected.
-
File attachments work, I think the only thing that needs to work is querying or selecting the proper files based on the Airtable records.
**Please let me know if there is additional information that needs to be provided to figure this out as a community. Thanks in advance! **
Hello chunkychoco,
As far as I can tell, you have 3 files in a google drive:
- Google Drive Files: You have three files in Google Drive - Option A, Option B, Option C.
- Email Attachment Goal: You want to attach the selected options to a single email.
- Workflow Steps:
- Create a route for each option (A, B, C).
- Check if the Airtable option is selected for each route.
- If selected, fetch file data and use a “Set Variable” module to store the data.
- After all three routes run, create a fourth route.
- In the fourth route, use a “Get Multiple Variables” module to extract files from all “Set Variable” modules. (Use unique variable names for each route.)
- Finally, attach these files to the email.
- Dynamic Routes: You might need different routes based on the number of options selected (1, 2, or 3).
I may have misinterpreted what you’re trying to do, if you only ever need to attach a single file, this process will be simpler.
3 Likes
@IOA_Brett, I thought of this, and this would work short term. However, there will be 8 files and then there would be too many routes. Not to mention if another file was added later on… What a nightmare!
So, I guess, rather than dynamic routes, is there syntax for dynamic queries in the Google Drive search file module? (ie. {A,B,C} where A, B, and C are different file names)