How to Generate & Send PDFs from Google Sheets

Is there a way to do the same thing as in this video: https://www.youtube.com/watch?v=QNUeVeaCBUw&t=4s
It is basically mapping data from a Google Sheets to a Google Docs temple using dynamic fields.
It then created a new doc.
Uses the new doc to create a pdf and then send the pdf to an email using Gmail.
thanks for your help guys :slight_smile:

hey @Sanjeev,

This might already be achievable with the new actions created by @PFernandez98. While I haven’t tested it myself, I suggest checking out this thread for more info and to try it out:

2 Likes

I can confirm it works perfectly and can fulfill your use-case @Sanjeev

2 Likes

Thanks @Dennis
Will check it out

Thanks for sharing @S_M :pray:

I’ve followed the steps but I am stuck at the last part where I need to attach the pdf to the email. It doesn’t seem to work. I must be doing something wrong. Would you mind helping out. Here is a screenshot:

@Sanjeev

Try adding a “Read File” action under the Google Drive piece and use the generated link as the attachment in Gmail.

Tried that but does not really work. It doesn’t attach the pdf. It attaches the generated link, which works on its owns but now as an attachment from the mail.

@Sanjeev

Awe, I haven’t really used the Send Email function with attachments yet on AP, but in theory it should work fine.

But since it doesn’t, try the “Read File” into “Upload File” action in Google Drive and see if it makes a difference selecting the outputted file there, as an attachment in Gmail.

Obviously, it seems unnecessary to do those extra steps, but could be helpful in troubleshooting / a temp workaround, if it’s successful.

@S_M
The thing is that with the “Upload File” action, it requests for the file URL. I can’t find out how to get that from the previous steps in the flow.

“Read File” returns a URL you can plug into the “Upload File” - this I’ve done and tested.

@S_M
Ok…tried that but still does not work

I thought we might need to convert the attachment file to Base64, but then I just tried (using the AP “Read File” action) and the email had no attachment when I selected the Base64 output as the attachment LOL

@PFernandez98 any chance you could take a look at the Gmail piece’s “Send Email” action - the Attachment field in particular - and potentially update it to support Google Drive ID’s? If it already supports Google Drive ID’s…please enlighten us. Or @abuaboud feel free to chime in, to clarify.

Update: So I noticed that the file you have here is the correct PDF, it just isn’t being recognized as such. I downloaded my file and added the .PDF extension and voila, it was the correct document/PDF.

Consequently, @PFernandez98 (or @abuaboud) any chance we can get a “Name” field added to the Attachments in the Gmail piece’s “Send Email” action. That would allow us to rename the PDF correctly, and also be useful in cases you want to rename a static document and make it look dynamic (i.e. generic.pdf → companyname.pdf) for example.

Thanks! Hopefully we can get a solution soon @Sanjeev

1 Like

@S_M, I’m gonna add this feature tomorrow. So maybe on sunday it’s gonna be live

2 Likes

Thanks a ton bro! Sorry to bother you :pray::muscle:

DONE!

image

3 Likes

Thank you so much for your help @S_M and @PFernandez98
:pray:

1 Like

You’re welcome!

PS: this is not live yet. I’ll let you know.

1 Like

Hey @Sanjeev it’s all @PFernandez98 - much respect to him!

1 Like