Create records in Airtable with Webflow Logic
Use Logic’s Make HTTP request block to send data from Webflow form submissions to Airtable.
With Airtable, you can create and manage databases of information that are important to your business. Logic lets you send data, such as a lead’s contact information, from form submissions to Airtable, connecting your Webflow site to your business database.
Before you get started: If you haven’t already, create an Airtable account and an Airtable base. You’ll also need to add a form to your Webflow site with fields that correspond to your Airtable table.
In this lesson, we’ll cover:
- How to create your Airtable API key
- How to set up your Logic flow’s authentication
- How to find your Airtable documentation
- How to set up your HTTP request
- How to test and publish your flow
- How to troubleshoot issues with your flow
Pro tip: Logic also lets you sync data from Airtable to the Webflow CMS using the Make HTTP request block or an Incoming webhook trigger. Learn more about making HTTP requests with Logic.
How to create your Airtable API key
Similar to a password, an API key (sometimes called an “access token”) identifies the site or application making an HTTP request to an API. You’ll need an Airtable API key to send data to Airtable.
To create your Airtable API key:
- Go to your Airtable dashboard
- Click on your profile icon and click Account
- Scroll to the API section and click Create token
- Click Create new token
- Give your token a name
- Click Add a scope and choose what you’d like to do with this API key from the dropdown menu (at a minimum, you’ll need to select data.records:write to send data to Airtable)
- Click Add a base and choose the Airtable base you want to send data to
- Click Create token, copy your API key, and keep this tab open!
How to set up your Logic flow’s authentication
- Open your site in the Webflow Designer in a new tab
- Select your form on the Designer canvas and open Form settings
- Click the Source dropdown and choose Logic
- Click Add new flow
- Give your new flow a name (e.g., “Send leads to Airtable”) in the Name field and add a description to the Description field if you’d like
- Drag a Make HTTP request block to the flow editor canvas and give it a name (e.g., “Create new lead record in Airtable”)
- Choose API token from the Authentication dropdown
- Choose Header from the Add to dropdown
- Enter “Authorization” in the Header field
- Click Select a credential > Add new credential
- Give your API token a name (e.g., “Airtable API token”) in the Name field and add a description to the Description field if you’d like
- Enter “Bearer {API key}” in the Token field, replacing the {API key} with the API key you copied from Airtable
- Click Create to save your new credential and keep this tab open!
Pro tip: You can also connect your form to a new Logic flow from the Logic panel > Flows tab. Learn more about form submission triggers in Logic.
How to find your Airtable documentation
- Return to your Airtable base
- Click Help and choose API documentation under Additional resources
- Select the table you want to create records in
- Click Create records — example API requests for your table will appear on the right
Important: Airtable’s API documentation is specific to each Airtable base, so make sure you’re in the base you want to add records to.
How to set up your HTTP request
Now that you’ve created your Logic flow and Airtable authentication credentials, you’ll need to return to Webflow and set up an HTTP request in your flow. The HTTP request you configure in this step will create a new record in your Airtable table each time a site visitor submits your form.
Note: If you closed the tab where your Webflow site was open, go to Logic panel > Flows tab and choose the flow you set up in the previous steps. Select the Make HTTP request block on the flow editor canvas to open block settings and complete the following steps.
- Click the Request method dropdown and choose POST
- Paste “https://api.airtable.com/v0/{id}/{name_of_table}” in the URL field, replacing the {id} with your table ID and the {name_of_table} with the name of your table
- Click the “plus” icon next to Headers to create a new header
- Enter “content-type” in the Name field and “application/json” in the Value field
- Paste the code block from your Airtable API documentation in the Body field — it will resemble this (but contain fields from your existing Airtable records):
{
"First Name": "XYZ",
"Last Name": "XYZ",
"Email": "ZYX@email.com",
"Status": "New lead"
}
Then, you’ll need to add dynamic data to your HTTP request to capture information from your form submissions:
- Delete the values from your existing Airtable record and place your cursor between the empty quotation marks in the Body field
- Click the purple “dot” icon and select the corresponding dynamic form field (e.g., name, email, etc.)
Important: Make sure to escape any spaces or special characters in the table name in the URL field.
How to test and publish your flow
- Click Run test to complete setup
- Enter sample values in the corresponding input field
- Click Run test
- Click Cancel or Apply data to exit the test modal
- Click Publish
- Click Stage flow for publish
- Publish your site
Note: If you receive an error message while testing your flow, follow our troubleshooting steps, then retry the above steps. Learn more about testing HTTP requests.
How to troubleshoot issues with your flow
If you’re receiving an error when testing your flow, try the following:
- Make sure you entered “Bearer” (and a space) before your API key when setting up your credentials (e.g., “Bearer 123456789”)
- Make sure your request URL contains the correct ID and name for your table
- Check for errors in your request body using a free tool like JSONLint