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
- Go to airtable.com/create/tokens.
- Create a token with
data.records:writescope for your base. - Copy the token (starts with
pat...).
2. Get Your Base ID
- Go to airtable.com/api and select your base.
- The Base ID is in the URL and starts with
app(e.g.,appXXXXXXXXXXXXXX).
3. Configure in Core Forms
- Edit your form > Actions tab > Add Action > Add to Airtable.
- Enter the Personal Access Token, Base ID, and Table Name.
- 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
- Parses the field mapping configuration.
- Builds a fields object with column names as keys and form values as strings.
- Appends
Submitted AtandFormmetadata. - POSTs to
https://api.airtable.com/v0/{base_id}/{table_name}with Bearer auth. - Array values (checkboxes) are joined with commas.
- The request times out after 20 seconds.
- Returns
trueif 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:writescope 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.