Create loan application records from social lead forms
Each new Facebook lead form submission becomes a loan application record in your Airtable intake table, with a readable timestamp, a cleaned-up phone number and revenue figure, campaign details and a source tag.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/create-loan-application-records-from-social-lead-forms/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Finance · Loan management
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/create-loan-application-records-from-social-lead-forms
Set it up with the CLI
- Add it. Copies the folder into
zaps/create-loan-application-records-from-social-lead-forms/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/create-loan-application-records-from-social-lead-forms - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy create-loan-application-records-from-social-lead-forms - Check it. Its recent runs, with status and errors.
npx zap-pack logs create-loan-application-records-from-social-lead-forms
zaps/create-loan-application-records-from-social-lead-forms/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 2 to fill in
- connections/airtable.tsThe
airtableaccount it uses - connections/facebook-lead-ads.tsThe
facebook-lead-adsaccount it uses - triggers/lead.tsWhat starts it:
facebook-lead-adslead2 to fill in - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a person submits the chosen lead form on a Facebook Page (
facebook-lead-ads,lead). - Filter: only qualifying submissions continue: there must be a full name and a valid-looking email. Anything else returns
skippedand writes nothing. - Formatting (plain code, not steps): the lead's
created_timebecomes a readable application timestamp (e.g.Oct 29, 2026, 10:15 AM UTC). The phone number keeps only digits and a leading+. A revenue answer such as$250kor1,200,000becomes a whole number. - Airtable upserts one record in the intake table, matched on email: if a record with that email exists it is updated, otherwise a new one is created. It writes the submission ID (external reference), application timestamp, full name, email, phone, business name, revenue estimate, campaign, ad set, ad and form names, and a single source tag.
Ask the user
Each REPLACE_… value is set per person. Resolve names to IDs with the user's own connections; don't ask them to paste an ID you can look up.
| Setting | Where | What goes there |
|---|---|---|
REPLACE_FACEBOOK_PAGE_ID |
triggers/lead.ts, page |
The Facebook Page whose lead form starts the Zap |
REPLACE_FACEBOOK_LEAD_FORM_ID |
triggers/lead.ts, form |
The lead form that starts the Zap; delete the line to take any form on the page |
REPLACE_AIRTABLE_BASE_ID |
config.ts |
The Airtable base that holds the loan applications (its ID starts with app) |
REPLACE_AIRTABLE_TABLE |
config.ts |
The intake table that receives the applications: its ID (tbl…) or exact name |
Also review the defaults with them:
- The
FIELD_*names inconfig.tsmust match the intake table's fields. The table needs a field named byFIELD_EMAIL, because records are matched on it. If the table lacks any of them, Airtable rejects the write: rename the constants to match, or add the fields. LEAD_PHONE_KEY,LEAD_BUSINESS_NAME_KEYandLEAD_REVENUE_KEYare the keys their form delivers. Facebook's standard questions arrive uppercased (PHONE_NUMBER,COMPANY_NAME); custom questions use whatever key the form defines. Sample a lead to confirm them.TIME_ZONE(default"UTC") andSOURCE_LABEL(default"Facebook Lead Ads"), the source tag written to every record.- What makes a submission qualifying. The default is a name and a valid email; add conditions in code if they want more, such as a minimum revenue.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/create-loan-application-records-from-social-lead-forms, replace each REPLACE_… value as this file says, then run npx zap-pack deploy create-loan-application-records-from-social-lead-forms, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
airtableto the user's Airtable connection for the account that owns the intake base. The trigger usesfacebook-lead-ads, so bind it to the user's Facebook Lead Ads connection for the Page. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/lead.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections and sample the trigger before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Run this sample as a draft test (run_workflow_draft in Zapier MCP) before publishing, against a test table or with an email that is clearly a test:
{
"id": "install-test-lead-0001",
"created_time": "2026-10-29T10:15:00+0000",
"FULL_NAME": "[install-test] Jordan Rivera",
"EMAIL": "install-test+loan@example.com",
"PHONE_NUMBER": "+1 (555) 010-2030",
"COMPANY_NAME": "[install-test] Rivera Bakery LLC",
"ANNUAL_REVENUE": "$250k",
"campaign_name": "[install-test] Small business loans Q4",
"adset_name": "[install-test] NYC owners",
"ad_name": "[install-test] Working capital ad",
"form_name": "[install-test] Loan application form",
"platform": "fb"
}
Check that one record exists for install-test+loan@example.com with the timestamp Oct 29, 2026, 10:15 AM UTC, phone +15550102030, revenue 250000 and the source tag. Run it again and confirm the same record was updated, not duplicated. Then run it with "EMAIL": "" and confirm it returns skipped and writes nothing. If run-status tools aren't available, check the result in Airtable directly. Ask the user to delete the test records; the agent does not delete test data.
Notes
- The Airtable write uses the app's raw API request action (a
PATCHwithperformUpserton the email field andtypecast: true), because the field-by-field Create Record action needs field keys that can only be read from a connected base.typecastlets Airtable create missing select options and convert text to numbers. - Emails are lowercased before matching, so
Jane@Example.comandjane@example.comare the same applicant. If more than one record has the same email, Airtable rejects the upsert, so keep emails unique in the table. - Facebook's Lead Ads Testing Tool can send a test lead, so you can sample real keys before publishing.
- The table holds applicants' personal and financial details. Never commit a real base ID, and limit who can see the table.
- To extend it: add a lookup before the upsert (for example, a campaigns table keyed by
campaign_id), or set a priority field when the revenue estimate passes a threshold.