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.
/img/guides/airtable/airtable-uc1-table-setup.pngCreate 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.
/img/guides/airtable/airtable-uc1-automation-trigger.pngAdd 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:
- Body: JSON mapping the input variables to your PolyDoc template fields
/img/guides/airtable/airtable-uc1-run-script.pngUpdate 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.
/img/guides/airtable/airtable-uc1-update-record.pngUse 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.
/img/guides/airtable/airtable-uc2-button-field.pngConfigure the Scripting extension
Install the Scripting extension from the Extensions marketplace if you haven't already. Open it and create a new script.
/img/guides/airtable/airtable-uc2-scripting-extension.pngWrite 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.
/img/guides/airtable/airtable-uc2-write-script.pngTest 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.
/img/guides/airtable/airtable-uc2-test-button.png