> 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/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/fiG3AE_VJLo>" %}

## Setup

{% stepper %}
{% step %}

### Connecting Documint and Airtable

First, connect your Documint account to Airtable. Follow this article to get that set up.

{% content-ref url="/pages/cmA1vQNIzcbRkp2Ai6ls" %}
[Connecting your Documint account with Airtable](/integrations/airtable/connecting-your-documint-account-with-airtable.md)
{% endcontent-ref %}
{% endstep %}

{% step %}

### **Connect the template with your database**

In the template builder, select the Airtable connection you made, pick the base, and the table you'd like to integrate with Documint. Then, continue to select the fields you'd like to use on your template.&#x20;

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FvUZrQ2EWCozdrYGq2beq%2Fselecting%20AT%20base_table.gif?alt=media&amp;token=c54f47e5-ca99-462e-b134-ef01a8165c9a" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create the Script

Under Sources, in the Airtable connection, click on "Add formula" and select the "Automation script" option.&#x20;

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FahhB1xvR1UloBL9xZce7%2Fadding%20script%20-%20AT%20connection.png?alt=media&amp;token=469e3565-8462-4b01-98da-c249e626014f" alt=""><figcaption></figcaption></figure>

In the table you have integrated the template with, add an attachment field to store the created document.

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FetTWzlkFgSoZXW4J1ebY%2FScreenshot%202026-03-10%20at%2015.49.03.png?alt=media&amp;token=bf606870-f628-4b4c-b529-912a9f9f8b02" alt=""><figcaption></figcaption></figure>

Go to the Automation Script tab, select the attachment field from the dropdown, and the Script will show up for you to copy.

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2F1IrHgXOC2L4WI8JGXn2K%2FScreenshot%202026-05-20%20at%2012.44.46.png?alt=media&amp;token=d053f10a-8afd-47e5-b4b4-b41152a4a549" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Create the Automation

Switch back to Airtable and open the Automations panel

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2Fk2ZfzQ7COy3PxVm9aldP%2FScreenshot%202026-03-10%20at%2015.51.28.png?alt=media&amp;token=0fc6684a-9a93-4793-98ef-89069464f8de" alt=""><figcaption></figcaption></figure>

Create a new automation and add your trigger. This can be any trigger that you'd like.

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FoN3Zrng04yayDdUimqdq%2FScreenshot%202026-03-10%20at%2015.54.02.png?alt=media&amp;token=e184d68e-4a04-4301-9361-222df8e65bb6" alt=""><figcaption></figcaption></figure>

Configure your trigger.

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FbHlg9PeYowRENMKujgCn%2FScreenshot%202026-03-10%20at%2015.58.47.png?alt=media&amp;token=0dc2fe09-92fe-4dc7-a032-4365a80cd31b" alt=""><figcaption></figcaption></figure>

Add an action and select 'Run script'

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2Fke8ibR1OkTKUZ9XH9lR4%2FScreenshot%202026-03-10%20at%2016.00.44.png?alt=media&amp;token=77af36dd-fdc8-4bbf-bc9c-68d00c9e8cf0" alt=""><figcaption></figcaption></figure>

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)

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)

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)
{% endstep %}
{% endstepper %}

## How to delete an Automation Script

If you have created an Automation Script and need to delete it, follow these steps to remove it:

1. Access the Sources panel

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FnASro3x7YogmgWYd9vBu%2Fsources.png?alt=media&amp;token=39872b8f-8df5-4330-b01c-93d2a21b873e" alt="" width="563"><figcaption></figcaption></figure>

2. Select the Automation Script you wish to delete, and

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FH4ELhMnur45quxRoWBxw%2Fautoscript.png?alt=media&amp;token=c9d6c0e6-9f1b-48d0-83e1-a54fd2b81a50" alt="" width="563"><figcaption></figcaption></figure>

3. Click the `delete` option at the bottom left of the popup

<figure><img src="https://1903534506-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTY5wPd81K7B5rjyG5tjS%2Fuploads%2FqWBpphOFtVMgGaeYptkr%2Fdelete%20autoscript.png?alt=media&amp;token=cc94eb3c-7710-4da8-96ca-9d852ea89316" alt="" width="563"><figcaption></figcaption></figure>


---

# 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/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.
