Extraction prompt that returns clean JSON every time

Messy text in, fixed fields out, and 'null' instead of guesses.

Emails, forms, transcripts, PDFs: any step that turns text into data.extractionjsonstructured output
ChatGPT Claude
Write an extraction prompt for an automation step that turns unstructured text into fixed JSON.

Input type: <emails / form submissions / call transcripts / PDF text / chat messages>
Three real or realistic examples of the input: <paste>
The fields I need, with type and meaning: <e.g. customer_name (string), request_type (one of: quote, support, other), urgency (1–3), amount (number, ILS)>
What to do when a field isn't in the text: <null / a default / flag it>
Language of the inputs: <Hebrew / English / mixed>

Produce:
1. The system prompt for the model node: role, the exact JSON schema with types and allowed values, rules for each field (how to recognise it, how to normalise it, what to do when absent), and the instruction to output ONLY JSON.
2. Rules against invention: the model must never infer a value that isn't stated; it uses null and adds the field name to a "missing" array.
3. Normalisation rules: dates to ISO, phone numbers to one format, amounts as numbers without currency symbols, names trimmed.
4. A "confidence" field per record (0–1) with a rule for when to route to a human.
5. Run the prompt mentally on my three examples and show the exact JSON you would expect for each.
6. Two adversarial inputs that would confuse a naive prompt, and how this prompt handles them.

Keep the prompt under 350 words.

Replace every <placeholder> with your own details before you send it.

How to use it

  1. 1Set temperature to 0 and enable JSON mode or structured output in your model node.
  2. 2Test with the ugliest real input you have, not the clean sample.
  3. 3Never let the model invent a missing field. null is a feature.

Reviewed 2026-09-20

Share this prompt

WhatsApp

Sharing a prompt is the easiest way to help another builder today.

Good prompts are a skill. Proof of what you build is a career.

Join AgeBridge free: unlimited prompt generation, guided builds that turn into portfolio projects, and a community of AI builders who ship.

  • Unlimited prompt generator
  • Guided builds that become proof on your profile
  • A public profile businesses can find

Prompt text is written by AgeBridge and free to use. Results depend on the model and on the details you provide.