# Airtable Extension

Docupilot's Airtable extension allows you to create your Contracts, Sales/Purchase Orders, Invoices, Employment Offer Letters, Real Estate Agreements, Marketing material and many more professional documents in PDF, Word, Powerpoint, Excel and other formats.

<https://airtable.com/marketplace/blkTR72VkH3OEjvPX/docupilot>

## Installation Guide

### Step 1: Adding an extension to the base

In the Airtable base, click on the `Extensions` button present on the RHS. A dialogue box will be displayed. Now, click on the button `Add an extension` in the dialogue box.&#x20;

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FX3grmqUuNrvzW8n8dGHS%2FSetup1.png?alt=media&#x26;token=a1f3e130-586d-4a77-a274-3c9cd1af39b4" alt=""><figcaption><p>Step 1 adding an extension to the base.</p></figcaption></figure>

### Step 2: Search Docupilot in the Market place

Once the button `Add an extension` is clicked, a pop-up of Airtable Marketplace will be displayed on the screen. In the pop-up search for Docupilot and click on it.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FgadFf7KP8E221IapvfF6%2FSetup%202.png?alt=media&#x26;token=d9264270-68ce-4ed5-8e58-cca1e042afaf" alt=""><figcaption><p>Step 2: Searching for Docupilot application in the Airtable Market place</p></figcaption></figure>

### Step 3: Selecting Docupilot as the extension

Once Docupilot is selected, the following will be displayed on the screen. Here click on `Add extension`. After doing so, a small pop-up will be displayed, click on `Add extension` button on the pop-up too.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FTA91JcNzkqWEsQqT9WK0%2FSetup%203.png?alt=media&#x26;token=fbaa2d9e-8366-456c-ad08-058b793d63cd" alt=""><figcaption><p>Step3: Selecting Docupilot extension from Marketplace</p></figcaption></figure>

### Step4: Setting up the API key

After clicking on `Add extension`, a pop-up of Docupilot will be displayed consisting of instructions to set up an API key and secret. Follow the steps and set up the key and secret on Docupilot after which click on `Get Started` button on the pop-up.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2Fb20j1DQ8z56jhTEGIZi9%2FSetup%204.png?alt=media&#x26;token=a9ad3a11-3f8f-4425-9989-418ddb6e3f4b" alt=""><figcaption><p>Step4: Instructions to setup API key in Docupilot</p></figcaption></figure>

### Step 5: Linking Docupilot and Airtable

On the following page, paste the API key and secret into their corresponding slots and click on save.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FB37FQBaPnRt7l8jtYixH%2FSetup%205.png?alt=media&#x26;token=0166ccbe-a164-4bb5-9300-9714eb809a0f" alt=""><figcaption><p>Step5: Linking Docupilot and Airtable</p></figcaption></figure>

Now the Docupilot extension is installed successfully onto the Airtable base.

## Document Generation &#x20;

### Step 1: Record and Template selection

After the installation of the Airtable extension to the base,  the first step towards document generation would be selecting the record(s) and the template.

<div align="center"><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FY9wdgyZphz1rwkXgGYvp%2FScreenshot%202022-03-18%20at%2012.14.19%20PM.png?alt=media&#x26;token=14b8c4dc-6722-4d12-933b-0f50b00d1960" alt="Record and template selection"></div>

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FZC6eIyNj5rpWJC5ebPKv%2FScreenshot%202022-09-23%20at%201.47.09%20PM.png?alt=media&#x26;token=ffed4dcc-0b3d-43ff-aefa-4cb8b1a14b9b" alt=""><figcaption><p>Multiple records selection</p></figcaption></figure>

### Step 2: Field Mapping

Once the record and the template have been chosen, we can see that a few fields will be pre-mapped based on the field name and the token name.&#x20;

The remaining fields need to be mapped manually.

![Field Mapping](https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FLRYNODnfedn7qAWxM3bY%2FScreenshot%202022-03-18%20at%2012.15.43%20PM.png?alt=media\&token=cd79901f-5ba5-4ba5-b684-a3c1fe074fe3)

### Step 3: Document Generation

After all the fields are mapped, clicking on the Generate document button will start document generation and one document will be generated for each record selected.&#x20;

For example, if 5 records are selected then 5 documents will be generated.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FV2csZRvQGdOuzawDmmVo%2FScreenshot%202022-09-23%20at%201.49.01%20PM.png?alt=media&#x26;token=424793ba-32d5-4ffb-baa9-e247721f3f8a" alt=""><figcaption><p>Selecting attachment field to upload the generated document</p></figcaption></figure>

![Document Generation](https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2F8LoTlwQyUqPjPk820USf%2FScreenshot%202022-03-18%20at%2012.19.29%20PM.png?alt=media\&token=4a965916-92cf-4763-820e-6efc3d30a446)

The generated document can either be saved into an attachment row in the Airtable base or can be delivered using the mode of delivery that is assigned to the template.

{% hint style="info" %}
Once the mapping is done for a template inside a base, it will be saved and when a new record is selected, the mapping will be done automatically.
{% endhint %}

## Automating Document Generation using Airtable Automations

To be able to automatically generate documents as part of your Airtable Automation setup, you can use the custom script generated by our Extension in "Run a Script" step.

To generate the code:

1. Select a record from your Airtable base
2. Select desired template from the Extension
3. Configure attachment field if desired
4. Map the fields
5. Click on the "**Generate Automation Code**" ( `< >` ) button to generate the automation script

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FfQbTBlh6JA3pmy4H0zoN%2Fcode%20generation%20new.gif?alt=media&#x26;token=2db39a00-4c95-4c53-b462-956f2cc9d1f2" alt=""><figcaption><p>Generate Airtable Automation code to automate document generation using Docupilot's Extension</p></figcaption></figure>

Use generated code in automations:

1. Copy the generated script
2. Paste it in your automation "**Run a Script**" step
3. Add an input variable "**recordURL**" and map it to "**Base Record URL**"

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FU755MuQMNF0RbeHdDyvP%2Fcode%20generation%20script.gif?alt=media&#x26;token=d0cf2a96-f475-44cc-80a7-3d26279c7abc" alt=""><figcaption><p>Utilizing a generated script in Airtable Automation to generate documents using Docupilot's Extension</p></figcaption></figure>

## Append PDFs

You can append up to 10 PDFs using the "Append PDF" option available in Docupilot's Airtable extension.

### Step 1: **Select Rows and Open the Extension**

In Airtable, select the row(s) containing the PDFs you want to append. Then, navigate to the **Append PDF** tab in the Docupilot extension.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FuwQWGz9cVttzXpOn8qiA%2FAppend%20PDF&#x27;s%20tab.png?alt=media&#x26;token=c2fe086c-8129-4970-8bb0-a077c91fc378" alt=""><figcaption><p>Select the row(s) with PDFs and open the Append PDFs tab</p></figcaption></figure>

### Step 2: **Choose Attachment Field for Upload**

From the dropdown, select the attachment field where the appended PDF should be uploaded.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FydFCtdKPSJ3l6e9IwlnW%2FSelect%20field%20to%20Upload%20Appended%20File.png?alt=media&#x26;token=5d0bf3e9-f650-484e-a60f-e4e3e8abf22e" alt=""><figcaption><p>Choose the attachment field from the dropdown to upload the appended PDF.</p></figcaption></figure>

### Step 3: **Select Columns**

If you have multiple attachment fields, select all the columns from which the attachments are to be appended.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FuPBWMhkJ4L2UmvlkUAY3%2FSelect%20Attachments%20Fields.png?alt=media&#x26;token=8a880f4d-3fb0-4a2b-b9af-5e23caf7c18f" alt=""><figcaption><p>Select the columns containing the attachments to be appended.</p></figcaption></figure>

<sup>*Please note that the order of your selection will determine the sequence in which the files are appended.*</sup>

### Step 4: **Append the Documents**

Click **Append Documents**. This will combine all selected files and place a single document in the chosen column of the respective row.

<figure><img src="https://191679573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LDwD-wIOendMUiQ8uVr%2Fuploads%2FaehJFHv8KjYXcFculRzf%2FAppended%20FIle%20Uploaded.png?alt=media&#x26;token=4f3ce1a0-a81c-46b2-9bb7-d9d3b2fdccac" alt=""><figcaption><p>Appended document is uploaded to destination attachment field</p></figcaption></figure>
