Skip to content

Building forms with AI

The AI builder is the heart of AmazingForms. This guide explains how to get the best out of it.

The AI builder understands plain English. You do not need special syntax. But better prompts produce better forms.

Include:

  • What the form is for (the business context)
  • Who fills it in
  • What fields you need (or a general description of what data you want)
  • What should happen after submission

Example — vague prompt:

A contact form

Example — good prompt:

A quote request form for my roofing business. Collect the customer's name,
email, phone number, home address, and photos of the problem area.
After submission: score how urgent the job looks, text me if it scores above 70,
and send the customer an email promising a callback within 24 hours.

The second prompt produces a 5-field form with a file upload, a workflow that calls an AI scoring step, a conditional SMS alert, and a personalised email reply.

AmazingForms uses a NL to readable DSL to validated schema pipeline. This is not an LLM writing raw PHP — it is safer and far more reliable.

  1. Natural language in — your prompt goes to a small reasoning model
  2. DSL generated — the model writes a readable intermediate language (structured YAML-like instructions)
  3. Validated — the DSL is checked against a schema of whitelisted primitives; invalid instructions are rejected, not executed
  4. Schema out — the form schema and workflow definition are written to the database

This means:

  • The AI cannot execute arbitrary code
  • Errors are caught before they reach your site
  • You can inspect and edit the output in the visual editor

After your form is built, every submission triggers an AI agent. The agent:

  1. Reads the submission data
  2. Reasons about it (qualification, urgency, sentiment, completeness)
  3. Executes the actions you described: replies, alerts, CRM updates, integrations

The agent uses hierarchical tool-calling: it first decides what kind of action to take, then fetches the configuration for that action. This keeps inference costs low — it never loads the entire plugin surface into context for a simple reply.

For the roofing quote form:

Agent: Read submission — John Smith, 14 Oak Lane, roof photos attached
Agent: Score urgency — photos show active leak, date mentioned "this week" — 91/100
Agent: Route — Hot (score above 70)
Agent: Send SMS to owner — "Hot lead: John Smith, 14 Oak Lane, 91/100 urgency"
Agent: Generate reply — personalised callback promise in owner's tone
Agent: Send reply to John Smith
Agent: Create CRM contact — tagged roofing, hot-lead, pipeline stage: New

All of this runs automatically, within seconds of submission.

AmazingForms supports two AI modes:

ModeHow it worksBest for
Managed creditsAmazingForms proxies calls to a small, cheap modelMost freelancers — lowest friction
BYOKYou supply your own API key (OpenAI, Anthropic, etc.)High volume, frontier models, data privacy

You can set per-form and per-workflow-step model preferences. Per-step routing means a lead qualification step can use a cheap fast model, while a nuanced reply generation step can use a stronger one.

In AmazingForms → Settings → AI:

  1. Select BYOK
  2. Enter your API key
  3. Select default provider and model
  4. Save

Your key is stored encrypted in wp_options and is never transmitted to AmazingForms servers.

After the AI builds a form, you land in the visual editor. Everything is editable:

  • Rename, reorder, delete fields
  • Change field types (text to textarea, select to radio)
  • Edit validation rules
  • Add or remove workflow steps
  • Change the AI reply template

The visual editor writes back to the same schema format — the AI and the editor speak the same language.

  • Prompt length: up to ~2,000 characters. Longer is fine but rarely helps.
  • Photos / files: always use the phrase “upload” or “attach” — the AI will add a file field.
  • Conditional logic: say “only show X if Y is answered” — the AI handles it.
  • Multi-step: say “split this into 3 steps” or “make it a wizard” — it will paginate the form.
  • Reply tone: paste 2-3 sentences of your own writing and say “reply in this tone” for better personalisation.