Create documents from Airtable using Interfaces and Automations

This article shows how to generate documents from Airtable using an Airtable Interface button and an Airtable automation.

In this example, the automation starts a Documents process that generates an invoice from Airtable record data. The generated file is attached to the record and can also be sent by email.

Prepare Airtable base and Interface

For this example, we use the Client orders Airtable base created from the Product catalog template.

We also created an Airtable Interface for this base. We will use it later to trigger the automation.

Airtable Interface page listing Client orders records with Name, Client, Order no., and Fulfill by columns

Note

To learn more about Airtable Interfaces, see the Airtable documentation.

Configure document generation process

Before setting up the Airtable automation, create a Documents process that generates an invoice from a DOCX template.

Create new process

Sign in to your Plumsail account or create one if needed.

In Processes, click Add process and select Premade template.

Plumsail Documents "What do you want to start with?" dialog with the Premade template option highlighted

In the template library, find the Airtable template.

Select premade template dialog with "Airtable" in the search box and the Airtable invoice DOCX template found

Enter a process name, select the output file type, and click Create. On the next screen, update the document template if needed.

The default template already includes all fields from the Airtable demo base, so we will keep it as is.

Airtable invoice process editor showing the DOCX template with tokens such as {{OrderNo}} and {{Client.Name}}

Open the Settings tab.

Template toolbar in the process editor with the Settings button highlighted

Use Template settings to configure the remaining process options. For details, see the user guide.

Template settings dialog with Template name, Output filename, Output file type set to PDF, and Template engine set to Modern

Add Gmail delivery

For this example, add a Gmail delivery.

Plumsail Documents also supports other delivery options. For more information, see Create delivery.

Send Gmail email delivery step with recipient, subject, and body using tokens such as {{@date}} and {{OrderNo}}

You can add multiple deliveries if the generated document needs to be sent or saved in several places.

Add Documents Airtable extension

In this example, the process is started by an Airtable automation triggered by a button in the Airtable Interface.

In the Airtable Interface, open Tools > Extensions, click + Add extension, find Plumsail Documents, and add it to the base.

Client orders table in the Airtable base with the Tools menu in the top-right corner

To finish setup, connect your Plumsail account. If you do not have one yet, sign up first.

Use the following settings for this example:

Edit document generation button dialog with the Airtable invoice process, Send invoice title, and Attach to record selected
  • Process to start: Select the Airtable invoice process created earlier.

  • Button title: Enter Send invoice.

  • Generation mode: Select Document for each record.

  • Result handling: Select Attach result document to the record and choose the Invoice field.

Note

For more information, see Use Plumsail Documents from Airtable.

Create Airtable automation

After saving the extension settings, open them again.

Plumsail Documents extension Settings panel with the Client orders table selected and the Send invoice button listed

Expand the Advanced section and click Generate script.

Extension button settings with the Advanced section expanded and the Generate script button highlighted

Copy the generated script and close the settings.

Script panel showing the generated Airtable automation script with the Copy script button highlighted

Next, open the Airtable Interface in edit mode.

Airtable Interface menu with the Edit pages option highlighted

Add a new button action.

Client orders list in the Interface with the Open link highlighted on a record row

Click Buttons > + Add button action.

Record detail page in edit mode with the Buttons panel open and Add button action highlighted

Name the button Send invoice and select Run automation as its action.

Button settings with Label set to Send invoice and the Action dropdown open on Run automation

If no automation exists yet, open the automation dropdown and click + Create new automation.

Button settings with the Automations panel open and Create new automation highlighted

Name the automation Start invoice process and click Continue in Automations.

Create a new automation dialog named Start invoice process with the Continue in Automations button highlighted

The automation already includes the When a button is clicked trigger. Add a new step by clicking + Add advanced logic or action.

Airtable automation with the When a button is clicked trigger and Add advanced logic or action highlighted

Select Run a script.

Airtable automation with the Run a script action added under the When a button is clicked trigger

Paste the script copied from the Documents extension into the Code field.

Edit Script window with the pasted script defining the process start URL and the payload schema

This script uses the extension configuration to start the same Documents process from an Airtable automation.

If you later change the extension settings, generate a new script and update it in the automation. If you add new template tokens or Airtable fields, make sure the updated script includes them.

Finally, create an input variable named RecordId and map it to the Airtable record ID.

Edit Script window with the RecordId input variable mapped to the Airtable record ID

Test the automation, then turn it on.

Start invoice process automation switched ON with the trigger and Run a script action marked as tested

Return to the Airtable Interface and publish it.

Interfaces tab showing "Interface has unpublished changes" with the Publish button highlighted

You can now generate invoices from the Interface by running the automation.

Published record page for Apse Realty order #418 with the Send invoice button highlighted

The generated invoices are attached to the Invoice field in the Airtable base.

Apse Realty order #418 record with the generated Airtable invoice.pdf attached in the Invoice field

The invoice is also sent to recipients through Gmail delivery.

Note

To learn more about Airtable Automations, see the Airtable documentation.

If you are new to Plumsail Documents, create an account to start a 1-month free trial.