Skip to main content

Airtable

Prerequisites

  • A PolyDoc account and API key — sign up for free, no credit card required. The free plan includes 150 PDF conversions per month.
  • An Airtable account — sign up for free, no credit card required.

Use Case 1: Auto-Generate PDFs from Records

Automatically generate a PDF whenever a new record is created in your table, using Airtable Automations and the built-in Scripting action.
When record created -> Run script (PolyDoc API) -> Update record

Set up your table structure

Open your base and make sure the table has all the fields your PDF template needs (e.g. name, email, amount). Add a URL or Attachment field to store the generated PDF link.

Screenshot placeholder: /img/guides/airtable/airtable-uc1-table-setup.png

Create an automation with a record trigger

Go to Automations and click Create automation. Choose the When a record is created trigger and select your table.

Screenshot placeholder: /img/guides/airtable/airtable-uc1-automation-trigger.png

Add a Run script action

Add a Run script action. Define input variables for each field you need, then use fetch() to call the PolyDoc API:

  • URL: https://api.polydoc.tech/pdf/convert
  • Method: POST
  • Headers:
    • Authorization: Bearer YOUR_API_KEY (get from the Dashboard)
    • Content-Type: application/json
    • X-Sandbox: true
  • Body: JSON mapping the input variables to your PolyDoc template fields
Screenshot placeholder: /img/guides/airtable/airtable-uc1-run-script.png

Update the record or send by email

Add an Update record action after the script to save the PDF URL back to the record. Alternatively, add a Send email action to deliver the PDF. Click Test to verify, then toggle the automation ON.

Screenshot placeholder: /img/guides/airtable/airtable-uc1-update-record.png

Use Case 2: On-Demand PDF via Button

Let users generate a PDF on demand by clicking a button directly in the table row, using the Scripting extension.
Button field click -> Scripting extension -> PolyDoc API -> Download

Add a Button field

Add a Button field to your table. Set the label to something like "Generate PDF". Under Action, choose Run script.

Screenshot placeholder: /img/guides/airtable/airtable-uc2-button-field.png

Configure the Scripting extension

Install the Scripting extension from the Extensions marketplace if you haven't already. Open it and create a new script.

Screenshot placeholder: /img/guides/airtable/airtable-uc2-scripting-extension.png

Write the PolyDoc API fetch script

Write a script that reads the clicked record's fields, calls the PolyDoc API with fetch(), and outputs a download link. Configure the API call the same way as in Use Case 1.

Screenshot placeholder: /img/guides/airtable/airtable-uc2-write-script.png

Test the button

Click the button on a test row. The Scripting extension runs, calls PolyDoc, and presents the PDF link. Verify the output, then share the view with your team.

Screenshot placeholder: /img/guides/airtable/airtable-uc2-test-button.png