Ask for tables and JSON without breaking your workflow
Goal: Ask for tables or JSON with a frozen schema; unknown stays null—no pretty fake fills.
Best for: Briefs, matrices, checklists, light automation handoffs.
Structured output fails when you underspecify keys or allow prose wrappers. Name columns/keys. Ban extra commentary. Validate JSON before you pipe it anywhere.
Ask for structure when you will paste into a sheet or script. Give a schema, one tiny example, and what to do if a field is unknown (null/TBD—not invented).
Why beginners skip this
Asking only “make a table” with no schema lets the model invent column names—downstream parse will break. Write the fields first.
Step 1 — Table ask
Practice “table only”: use a real list you have; do not invent rows.
Return ONLY a markdown table with columns: [A | B | C].
No intro paragraph. Unknown allowed. Do not invent values.
Step 2 — JSON ask
Then JSON: freeze the schema first, paste notes in; unknown fields stay null.
Return ONLY valid JSON with keys: title (string), bullets (array of 3 strings), risks (array of 2 strings).
No markdown fences if the app wraps JSON for you—otherwise one fence.
If unknown, use null or "Unknown"—do not invent.
Example
Filled prompt
Extract meeting actions into JSON with fields: owner, task, due (YYYY-MM-DD or null), source_quote. If due unknown use null—do not invent dates. Provide one example object then parse this note: [paste].
What good output looks like
- Goal/Format/Boundaries all present for “Get markdown tables or simple JSON you can paste i”
- One example beats stacked IMPORTANT words
- Version/date kept when template changes
- Pass/fail: zero clarifying turns on live task
Step 3 — Validate
Paste JSON into a validator or JSON.parse in a scratchpad. Tables: paste into Sheets and check column counts.
Scene: Sheets without tears
The model returns ONLY the table. You paste into Sheets; columns line up. No essay wrapper to delete. Unknown cells stay empty on purpose.
Refuse pretty invalid JSON
If the model wraps JSON in commentary, send it back. Pretty-but-invalid breaks pipelines. Prefer boring valid output.
Your last reply was not valid JSON. Return ONLY the JSON object with keys [list]. No commentary.
Example
Filled prompt
From messy meeting notes, output JSON array of decisions: {decision, owner|null, due|null, quote}.
If missing → null, never invent. Return JSON only + one Unknown note.
What good output looks like
- One example beats stacked IMPORTANT words
- Version/date kept when template changes
- Pass/fail: zero clarifying turns on live task
- Goal/Format/Boundaries all present for “Get markdown tables or simple JSON you can paste i”
Save this card
Card: Want structure—give a schema; unknown stays unknown—no pretty fake values. Keep this beside the tool; read before you start.
Before you start
Keep the last failing output visible. You will repair the prompt for “Ask for tables and JSON without” against that failure—not a fresh toy ask. Guide: prompt-structured-output-json-tables. Keep the real job visible the whole time; a blank box means stop and fetch the artifact first.
How to use this week
This week for a real task write a JSON/table schema: field names + types + required; no run without the schema.
Keep it real
Run this guide’s Practice now on work you will actually ship this week—not a fictional scenario. Dated notes beat perfect theory.
Ship the practice
Close the tab only after Practice now is done on a real artifact.
Do not bookmark-only
Finish Practice now, then tick this guide on your path. Titles unread are not skills.
Close the loop
Write one line: next time I run with no schema, I refuse.
Check the unknown path
What should the model do when a field is missing—null, TBD, or ask you? Write it once in Boundaries.
Example
Filled prompt
From notes, JSON array: {decision, owner|null, due|null, quote}.
Missing → null. JSON only + Unknown note. No invented owners.
Valid JSON only; unknown → null; no trailing commentary.
What good output looks like
- Version/date kept when template changes
- Goal/Format/Boundaries all present for “Get markdown tables or simple JSON you can paste i”
- Pass/fail: zero clarifying turns on live task
- One example beats stacked IMPORTANT words
Red flag
Pretty fake values for unknowns; no schema—require unknown to stay unknown.
Pitfalls
| Pitfall | Fix |
|---|---|
| “Make a table” with no columns | Name columns |
| Accepting commentary + JSON | ONLY JSON rule |
| Invented fields to look complete | Ban extra keys |
Example
Filled prompt
Temptation: skip the habit for prompt-structured-output-json-tables to save five minutes.
Job still: Get markdown tables or simple JSON you can
Smallest correct pass: Done visible · checkable artifact · Unknowns [?].
Boundaries: draft only; no silent send; no invented metrics.
Return: artifact + refuse-line said aloud.
What good output looks like
- Names the shortcut refused (specific to prompt-structured-output-json-tables)
- Still delivers checkable output for “Ask for tables and JSON without”
- Unknowns labeled; draft-only
- Pass/fail: refuse-line dated (prompt-structured-output-json-tables #4)
Practice now
Null policy: define how nulls appear—never silent omit (Asia/Shanghai).
Invalid reject: feed one invalid row; model must refuse (Asia/Shanghai).
Schema freeze: freeze schema before generating rows (Asia/Shanghai).
Structured drill: one JSON/table schema; reject free prose that breaks it (Asia/Shanghai).
Thin-spot drill: rewrite the Save card with real nouns from your work (repo, doc, inbox). Generic placeholders fail the drill.
Tonight write a three-line schema (name+type+required) for real material, then generate JSON/table.
Habit stamp: after one live pass, write the refuse line you actually used on the Save card and date it (Asia/Shanghai).
Today card (copy) — prompt-structured-output-json-tables: 1. Artifact I will produce: ___ 2. Pass/fail check: ___ 3. Refuse-line if tempted to skip verify/send: ___ (date: Asia/Shanghai) 4. One never-do from this guide: ___
Extra pass: do the card on a real file today—reading alone does not count.
One sentence takeaway
Field names + types + required; no run without the schema.
Next
要表格与 JSON,且不弄乱工作流
目标: 拿到能直接贴进文档或表格的 markdown 表,或简单 JSON。不编造字段,也不产出坏语法。
适合: 简报、矩阵、清单,以及要交给轻度自动化的交接。
结构化输出常在两处翻车:键没写清,或允许散文把 JSON 包起来。请写清列名和键名,并禁止额外评论;接到任何流水线前,先校验。
真要贴进表格或脚本时,就明说要结构:给 schema,附一个小例子,并写清字段未知时怎么办(null 或 TBD,不要编造)。
为什么新手跳过
只要「整理成表」不写 schema,模型会自由列名;下游解析会炸。先写字段。
步骤 1——要表
先练「我只要一张表」:材料用你手头真实清单,别编行。
只返回 markdown 表,列名为:[A | B | C]。
不要写开场段落。允许填 Unknown。不要编造值。
步骤 2——要 JSON
再练 JSON:先把 schema 写死,再往里贴笔记;未知用 null。
只返回合法 JSON,键:title(字符串)、bullets(3 个字符串的数组)、risks(2 个字符串的数组)。
如果下游应用自己会包 JSON,就不要再套 markdown 围栏;否则只用一个围栏。
未知就用 null 或 "Unknown":不要编。
实例
填好的提示词
把会议行动项抽成 JSON,字段:owner、task、due(YYYY-MM-DD 或 null)、source_quote。到期日未知就用 null:不要编日期。先给一个示例对象,再解析下面这条笔记:【粘贴】。
像样的输出大概长这样
- 字段 schema 写清:owner / task / due / source_quote
- 到期未知用 null,绝不编日期
- 先给一个示例对象再解析笔记
- 输出可被程序直接吃,不夹解释段落
- source_quote 能回溯到原句
步骤 3——校验
把 JSON 丢进校验器,或在草稿里跑一次 JSON.parse。如果是表格,贴进 Sheets,看列数齐不齐。
场景:不掉眼泪的 Sheets
理想情况:模型只返回表格;你贴进 Sheets,列正好对齐;没有要删的散文外壳;Unknown 格故意留空。
拒绝好看但非法的 JSON
如果模型用评论把 JSON 包起来,打回去。好看但非法会弄坏流水线。宁可要无聊的合法输出。
你上一条不是合法 JSON。只返回键为 [列表] 的 JSON 对象。不要评论。
实例
填好的提示词
模型返回几乎是 JSON,但尾部拖着评论。请写一条修复提示词:只返回符合 schema 的合法 JSON;未知用 null;禁止解释性尾巴。
边界:不编造;未知标 [?];发送前停下。
完成检查:一分钟内能判过/不过。
像样的输出大概长这样
- 修复提示只要合法 JSON,不要尾部评论
- 明确「符合既定 schema」
- 禁止 markdown 代码围栏外的碎碎念
- 失败时说明如何再试一次,不换字段名
- 短到能置顶在每次抽取对话
- 未知标出;不编造负责人、日期或指标
保存这张卡
记下:今天改管用的那条提示词(含边界)+ 版本或日期。
开始前
调试时把上一次失败输出留在眼前。
本周怎么用
本周对一个真任务写 JSON/表头 schema:字段名 + 类型 + 必填;缺 schema 不跑。
保持真实
用本周真要交付的工作做「现在就练一次」,别编假场景。带日期的实操笔记,比完美理论有用。
把练习做完
用真实材料做完「现在就练一次」,再关标签页。
不要只收藏
先做完「现在就练一次」,再在学习路径上打勾。只收藏不练,标题变不成技能。
闭环
写下一行:下次缺 schema 就开跑,我拒绝。
检查未知路径
字段缺失时模型该怎么做:填 null、写 TBD,还是问你?在边界里写清楚一次。
红旗
只要「整理成表」不写 schema,模型会自由列名,下游解析会炸;先写字段。
常见坑
| 坑 | 改法 |
|---|---|
| 到期日未知就编一个 | 用 null,不编日期 |
| JSON 尾部拖评论 | 修复提示:只要合法 JSON |
| 没有示例对象 | 先给示例再解析笔记 |
现在就练一次
今晚就练:对一个真任务写 JSON/表头 schema:字段名 + 类型 + 必填;缺 schema 不跑。
一句话带走
字段名 + 类型 + 必填;缺 schema 不跑。
下一步
← Back to home · Learn · Tools · Compare · Start