> For the complete documentation index, see [llms.txt](https://docs.documint.me/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.documint.me/~/changes/155/integrations/airtable/automation-script.md).

# Automation Script

This feature allows you to create documents within Airtable, automatically, using Airtable automations.

Create documents automatically using Airtable Automations.

{% embed url="<https://youtu.be/xhg7RK9LuPg>" %}

## Setup

### Add your Airtable PAT key to Documint

First, add your Airtable PAT key to connect your Documint account to Airtable. Follow this short video to get that set up.

{% embed url="<https://youtu.be/pmbUnwMbu_A>" %}

#### Step 1

Copy the URL of the table from which you'll be creating documents

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FgN2Y7iQNlvmdyN67NRAu%2FStep%201.png?alt=media\&token=a2ad79c2-5e26-4d7e-885c-8f1b7700f22a)

#### Step 2

Navigate to your Documint template and open "Integrations"

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FKOOJNI289t3zuVqVhBBy%2FStep%202.png?alt=media\&token=66c3eeff-f08a-4414-b4f3-401de20cca66)

#### Step 3

Select "Airtable"

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FHcr5XgrFYSAKuX6NXzOR%2FStep%203.png?alt=media\&token=3dcfe807-e801-427d-92a2-26102e968aff)

#### Step 4

Paste the table URL in the Table URL field and add the Attachment field name.

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FovExLYWzpFbXRrY3TmLG%2FStep%204.png?alt=media\&token=ef01dffb-c390-4e52-ae01-b3747f7266ab)

#### Step 5

Copy the script

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FKWbEKwb1zzdGx3hS9djR%2FStep%205.png?alt=media\&token=32bf58f0-5087-4eb7-bd20-5a08f95e182a)

#### Step 6

Switch back to Airtable and open the Automations panel

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2F6ED7P3MLIL8o9PgJXhvX%2FStep%206.png?alt=media\&token=52ab8ce2-6908-4b02-a8b8-2d1972508dcd)

#### Step 7

Create a new automation

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FC6Pe6zH11CJQeUgNEKzL%2FStep%207.png?alt=media\&token=8cc92bf0-77fb-4a76-91e3-9662103442c1)

#### Step 8

Add your trigger. This can be any trigger that you'd like.

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FhNHzQukQ8AbJs2Gq36LJ%2FStep%208.png?alt=media\&token=3c8c4171-978d-49e7-abe7-50c6d2459fce)

#### Step 9

Configure your trigger.

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FRSAk1BZLFVXyfSrrBW71%2FStep%209.png?alt=media\&token=d2e4c82c-2ea7-4ca6-afd4-d9256963c29b)

#### Step 10

Add an action

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2F0RXxJTsQgIeGWIbv4HwP%2FStep%2010.png?alt=media\&token=e4f70489-7318-4d86-94e3-34341e973b6a)

#### Step 11

Paste your script

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FqQqxP8YjThka1t6gucS2%2FStep%2011.png?alt=media\&token=8e68302a-9716-45c7-aed9-50a5c79f7419)

#### Step 12

Add an input variable named `record_id` and set the value to the `Record ID`

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2F6nxIZUEpaTsNVcEkQxVY%2FStep%2012.png?alt=media\&token=9e846b28-4587-4969-84bf-63950d46bce6)

#### Step 13

Test your script and click `Finish editing`

![](https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FJDmcxApAxoH9n4QbiZVN%2FStep%2013.png?alt=media\&token=92fde7d5-6402-413f-9bf4-949f9480d0fa)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.documint.me/~/changes/155/integrations/airtable/automation-script.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
