šŸš€ New: Run requests via webhooks. Learn more

How to Enrich New Leads from a Contact Form in Airtable

Jul 28, 2022ā€¢Rosie Threlfall

In this easy-to-follow guide, we'll use Data Fetcher and the Clearbit API to enrich a list of email leads (taken from a contact form) with extra information about the person and the company they work for.

For each email, we'll look up attributes such as the person's name, their LinkedIn handle and the industry of their company. You can then use this information to tailor your outreach to the leads.

We'll be using the Clearbit API, and this tutorial has no need for code.

What is Clearbit?

Clearbit is sales intelligence software. It combines public and private data from the web about companies and makes this available through an API. Data Fetcher integrates with Clearbit, so there is no need to understand APIs to use their data.

Create Leads Table

First, create a new table in your Airtable base called 'Leads'. Keep the existing 'Name' field and add a new field called 'Email' with type 'Email'. Next, add a new field called 'Message' with type 'Long text'.

Enter the leads/ emails that you want to enrich, one in each record, in the 'Email' field.

Enrich-New-Leads1.png

Next, use the Create menu to generate a new Contact Form.

Enrich-New-Leads2.png

Remove the 'Name' field from the contact form.

Enrich-New-Leads3.png

Then set both the 'Email' and 'Message' fields to Required.

Enrich-New-Leads4.png

Get a Clearbit API Key

Next, you'll need to locate your API key from Clearbit. If you don't already have one, sign up for a Clearbit account. Then you can find your Clearbit API key here in the Clearbit dashboard.

Install Data Fetcher

Next, you'll need toĀ add Data Fetcher to your base from the Airtable marketplace.Ā This free extension enables you to import many different types of data into Airtable.Ā 

After you have added the Data Fetcher extension to your Airtable base, either create a free Data Fetcher account or sign in to your existing account using the 'Have an account?' button on the bottom left of the screen.

It's also easy to sign-up to Data Fetcher with your Google account by selecting 'Continue with Google'.Ā 

Data Fetcher Sign Up

Enrich New Leads From a Contact Form

Select 'Create your first request' from the Data Fetcher home screen. Data Fetcher requests enable us to import our data. You can create multiple requests for each Airtable base within Data Fetcher, although you can only add one extension per base on the Airtable Free plan.

Create your first request in Data Fetcher

On the create request screen, select 'Clearbit' for Application.

Enrich-New-Leads5-application.png

Under Authorization Copy and paste your (secret) API key into Data Fetcher.

Enrich-New-Leads5-auth.png

For Endpoint select 'Look up person & company info from email address(es)'

Enrich-New-Leads6-endpoint.png

Enter a Name for your request such as 'Enrich Email Leads' and click 'Save & Continue'.

Enrich-New-Leads6.png

On the next screen, click the + button and add a reference to your Email field then click 'Confirm'.

Enrich-New-Leads7.png

The Email field should now contain a reference to your output table. Click 'Save & Run'.

Enrich-New-Leads8.png

TheĀ Response field mappingĀ modal will open, where you are able to configure how the available fields from Clearbit will map to fields in your output table.Ā 

For each field name from Clearbit, you can either import it or filter it. For an imported field, you can either map it to an existing field or create a new field in your output table. You can also set the field type for each new field.

Click filter all to remove any pre-selected fields, then use theĀ Find fieldĀ search bar to locate the fields you want to import.

Map the 'Person name full name' field to the existing 'Name' field by clicking 'Existing field' and then selecting 'Name'.Ā 

Map 'Person linkedin handle' and 'Company name' to new fields.

Map 'Company domain' to a new URL field.

Map 'Company category industry' to a new field called 'Company industry' and 'Company metric employees' to a new field called Employees

Click 'Save & Run'.

Enrich-New-Leads9.png

Data Fetcher will create any fields that need to be created in the output table, then run the request and enrich the email leads with company and person information from the Clearbit API.

Enrich-New-Leads10.png

In order to run this request and enrich the email leads every time an email address is submitted from the contact form, we'll need to create an automation in Data Fetcher.Ā 

To do this, underĀ Schedule, 'Turn on webhook for request' and then copy the URL.Ā 

Enrich-New-Leads9.png

Then click onĀ Automations at the top of the screen and select 'When a form is submitted.

Enrich-New-Leads10.png

Under CONFIGURATION Select your table and contact form.

Enrich-New-Leads11.png

Then select 'Run script' from the Run actions menu.

Enrich-New-Leads12.png

Then paste the webhook into the Edit Script window.

Enrich-New-Leads13.png

Copy this script:

await fetch(`YOUR_WEBHOOK_URL?record_id=${input.config().record_id}`)

And paste it above the webhook in the script window in Airtable.

Enrich-New-Leads17.png

Next, replace YOUR_WEBHOOK_URL with your webhook URL.

Enrich-New-Leads18.png

Next, we want to replace input.config().record_id with the Record Id from the trigger of the form being submitted.

Enrich-New-Leads20.png

Click on + Add input variable.

Enrich-New-Leads21.png

Add record_id into the Name box.

Enrich-New-Leads22.png

For Value select 'Record (from Step 1: When a form is submitted)'.

Enrich-New-Leads23.png

Insert 'Airtable record ID'.

Enrich-New-Leads24.png

Click 'Test' in order to Test output.

Enrich-New-Leads25.png

You should now see 'Test ran successfully'.

Enrich-New-Leads26.png

Next, turn on your Automation.

Enrich-New-Leads27.png

Now you can test your contact form by selecting 'Open form'.

Enrich-New-Leads28.png

Add an Email address and Message and click 'Submit'.

Enrich-New-Leads29.png

A new record will now be created in your output table, and the corresponding fields populated with the data available on your new contact.

Enrich-New-Leads30.png

Related Posts

How To Import Data into Airtable When a Record is Updated

How To Import Data into Airtable When a Record is Updated

Aug 9, 2022

ā€¢

Rosie Threlfall

ā€¢Currency ConversionWebhook
Enrich Emails with Company Info in Airtable

Enrich Emails with Company Info in Airtable

Feb 17, 2022

ā€¢

Andy Cloke

ā€¢Clearbit
Find Domains from Company Names in Airtable

Find Domains from Company Names in Airtable

Sep 30, 2021

ā€¢

Andy Cloke

ā€¢Clearbit