Help

Automating a "print view" then sending it as a PDF in an email

Topic Labels: Automations
8708 6
cancel
Showing results for 
Search instead for 
Did you mean: 
hazeldjay
5 - Automation Enthusiast
5 - Automation Enthusiast

Hi,
One of my special views is a report to my client.
Usually I “print” this by saving the PDF and the emailing that PDF to my client
Is there a way to automate this in Airtable?
Thanks Hazel

6 Replies 6

Yes and no.

Yes, there are ways to automate the creation and emailing of PDF files (I and others do it), but not in the sense of “printing” a view to a PDF as you’re doing now. What we’re doing (very long story short) is creating HTML to design the look of a page based on Airtable data, sending that HTML to a web service to turn it into a PDF file, saving that PDF back to Airtable, then sending the PDF via email. This is all done through one or more automations that run scripts, so your base would need to be in a Pro-plan workspace to pull this off. It takes a good bit of time to set up, but it works wonderfully once it’s all configured.

@kuovonne has a more polished system for doing this than I do—mine still relies on Integromat for part of the process (though not for long), whereas Kuovonne’s setup is more self-contained—and there may be others out there who I don’t know who use other methods than what I’ve described above. If you have a budget for working with a consultant to get this set up, give us a shout directly, or post in the #developers:work-offered category.

There are two main aspects to this issue: (1) generating the pdf, and (2) emailing the file.

When it come to generating the pdf file, are you saving a report from Page Designer to PDF or are you printing the actual table view to PDF?

If you are using Page Designer, there is no way to automatically turn the resulting report into an attachment. You must manually print to pdf and manually upload the attachment. On the other hand, there are a variety of tools that will automatically generate a pdf file for a record and upload it as an attachment. All of these tools have their pluses and minuses, and the best tool depends on budget, document complexity, number of documents generated per month, ease in generating templates, etc.

If you are creating a pdf by saving a table view, you have fewer options. To my knowledge, no third party tool will create a pdf report from a table view (versus a record). If I were automating this, I would use a scripting automation action that retrieves the data from the view, generates HTML to resemble the desired look, and converts the html to a pdf file using a third party service, and then upload the pdf file to a target record.

Once the file is in an attachment field, you can email the file using Airtable automations. There are several different email actions, but one of the most popular is using Google email. When you configure the email action, indicate field that contains the attachment you want to send. Note that sometimes it takes several seconds for an attachment to become fully uploaded, so you may need to have a delay between the creating the pdf file and uploading it, and actually sending the email.

hazeldjay
5 - Automation Enthusiast
5 - Automation Enthusiast

Thanks Kuovonne and Justin,

That’s hugely helpful. Let me check my understanding. The gist of both your replies is to create the pdf, save that pdf as an attachment to a record and then automate an email to send the attachment.

Currently I am not using page designer; just the standard print view function.

The automated email - second aspect Kuovonne - I can handle. It’s going to be part 1 that challenges me by the sound of things. One pdf a month at the moment so the manual option isn’t too onerous.

I am using a Pro plan - so what is the best way to automate the creation of the pdf? BTW I’m not a developer so my scripting skills and HTML are minimal. An app would be better if there is such a beast? I’m guessing there is not.

Yes, that is the bird’s eye workflow. Note that since you are printing a table view, you do not have a built in record to upload the attachment to. In cases like this I typically have an “email table” and create a new record in that table.

Great!

As I said before, I have not heard of any off-the-shelf tools that will automatically create a pdf attachment from an entire table view. Thus, any solution would involve code. This is not a novice coding project, so that brings up the question—do you have budget to hire someone to write the code for you, considering that this is a once-a-month task?

If you are interested in hiring me, you make an appointment to discuss your specific details.

David_Weiss2
6 - Interface Innovator
6 - Interface Innovator

Hey there! Is generating the HTML code still the best approach to generate a PDF (or image) and send it as attachment @kuovonne @Justin_Barrett ? I want to send charts based on airtable data by email but have currently no way of generating them.

@David_Weiss2 I'm hesitant to say that it's the "best" method, if only because I haven't done a deep dive into other options (my work has never involved creating charts, so that's another aspect I can't speak to). However, the HTML-to-PDF method can be done purely via automations. Most other methods I know of involve custom extensions, which means they require user intervention.