Skip to main content

Airtable Integration

Add a record to an Airtable base for each form submission.

Action type: airtable Class: Core_Forms\Actions\Airtable Source: src/actions/class-airtable.php

Setup

1. Create a Personal Access Token

  1. Go to airtable.com/create/tokens.
  2. Create a token with data.records:write scope for your base.
  3. Copy the token (starts with pat...).

2. Get Your Base ID

  1. Go to airtable.com/api and select your base.
  2. The Base ID is in the URL and starts with app (e.g., appXXXXXXXXXXXXXX).

3. Configure in Core Forms

  1. Edit your form > Actions tab > Add Action > Add to Airtable.
  2. Enter the Personal Access Token, Base ID, and Table Name.
  3. Optionally configure field mapping.

Settings Reference

Setting Required Default Description
Personal Access Token Yes -- Airtable PAT (pat...)
Base ID Yes -- Airtable Base ID (appXXXXXXXXXXXXXX)
Table Name Yes -- Exact name of the table (e.g., Form Submissions)
Field Mapping No Auto-map Maps form fields to Airtable column names

Field Mapping Format

One mapping per line, form_field=Airtable Column:

name=Name
email=Email
message=Message

When left empty, form fields are auto-mapped using the field name with underscores replaced by spaces and the first letter capitalized.

Auto-Added Fields

Two metadata fields are always included in each record:

  • Submitted At -- submission timestamp
  • Form -- form title

Ensure these columns exist in your Airtable table, or they will be silently ignored.

Example

Form with name, email, and budget fields:

name=Contact Name
email=Email
budget=Budget Range

Creates an Airtable record: | Contact Name | Email | Budget Range | Form | Submitted At | |---|---|---|---|---| | Jane Smith | jane@example.com | $10k-$25k | Contact Form | 2026-04-09 10:30:00 |

How It Works

  1. Parses the field mapping configuration.
  2. Builds a fields object with column names as keys and form values as strings.
  3. Appends Submitted At and Form metadata.
  4. POSTs to https://api.airtable.com/v0/{base_id}/{table_name} with Bearer auth.
  5. Array values (checkboxes) are joined with commas.
  6. The request times out after 20 seconds.
  7. Returns true if the response status is below 400.

Troubleshooting

  • "NOT_FOUND": Verify the Base ID and Table Name are correct. Table names are case-sensitive.
  • "INVALID_PERMISSIONS": Ensure your token has data.records:write scope for the target base.
  • Missing columns: Airtable creates new columns automatically for single-line text fields. Other field types may require the column to exist first.
  • Field type mismatch: All values are sent as strings. If an Airtable column expects a number, date, or other type, the API may reject the value.