Hello, it’s a pleasure to greet you!
I’d like to share a scenario I’ve been struggling with and the solution I eventually implemented, to ask for your thoughts on whether it’s considered a good practice or if there might be a more efficient approach I’ve yet to discover.
The goal:
My aim is to automate the process of sending proposals in PDF format. The ideal flow would be as follows: when I update a specific PDF file in a Google Drive folder (e.g., “Proposal - Juan Perez.pdf”), the system should grab the latest version of that file and email it to the corresponding recipient, whose name and email address are stored in a row of a Google Sheets document.
The first attempt (and the issues):
My initial approach was what seemed most logical:
*Google Drive (Watch Files): Use a trigger to detect when a file is modified in the folder.
*Google Sheets (Search Rows): Look up a row in the sheet where the name matches the one extracted from the PDF file.
*Google Drive (Download a File): Download the detected file.
*Gmail (Send an Email): Send the email to the matched recipient.
What’s the issue now? When the document is sent, the system emails it to everyone on the list instead of just the last person in the Google Sheets row. Additionally, it attaches files that don’t match the person’s name. For example: Name: Juan Pérez; Attached file: Proposal - Daniel Gonzalez.
I honestly don’t know what else to try.
Thank you very much in advance.