{"id":8121,"date":"2026-11-23T23:09:50","date_gmt":"2026-11-23T23:09:50","guid":{"rendered":"https:\/\/jonjones.ai\/uncategorized\/daily-tip-tuesday-airtable-unknown-field-name-2026-11-24\/"},"modified":"2026-11-23T23:09:50","modified_gmt":"2026-11-23T23:09:50","slug":"%e6%af%8f%e6%97%a5%e5%b0%8f%e8%b2%bc%e5%a3%ab-%e6%98%9f%e6%9c%9f%e4%ba%8c-airtable-%e6%9c%aa%e7%9f%a5%e6%ac%84%e4%bd%8d%e5%90%8d%e7%a8%b1-2026-11-24","status":"publish","type":"post","link":"https:\/\/jonjones.ai\/zh\/%e4%ba%ba%e5%b7%a5%e6%99%ba%e6%85%a7%e8%87%aa%e5%8b%95%e5%8c%96\/%e6%af%8f%e6%97%a5%e5%b0%8f%e8%b2%bc%e5%a3%ab-%e6%98%9f%e6%9c%9f%e4%ba%8c-airtable-%e6%9c%aa%e7%9f%a5%e6%ac%84%e4%bd%8d%e5%90%8d%e7%a8%b1-2026-11-24\/","title":{"rendered":"\u9031\u4e8c\u5c0f\u8cbc\u58eb\uff1a\u5728\u4ee3\u7406\u4eba\u5411 Airtable \u5beb\u5165\u8cc7\u6599\u4e4b\u524d\uff0c\u8acb\u6aa2\u67e5\u6b04\u4f4d\u540d\u7a31\uff08\u6211\u7684\u6620\u50cf\u8173\u672c\u81f3\u5c11\u5f9e 10 \u6708 9 \u65e5\u958b\u59cb\u5c31\u4e00\u76f4\u63d0\u793a\u300c\u672a\u77e5\u6b04\u4f4d\u540d\u7a31\u300d\uff09\u3002"},"content":{"rendered":"<p>Today&#8217;s tip is short: <strong>before your agent writes to Airtable, check that every field name it sends actually exists in the table.<\/strong> It takes one API call. I&#8217;m writing about it because my own image script hasn&#8217;t been doing it.<\/p>\n<h2>What broke<\/h2>\n<p>Every image on this site goes through one script: generate, compress, upload to the CDN, upload to WordPress. The last step logs the image to an Airtable table called Generated Images. It sends five fields: Image Model, Image URL, Name, Prompt, Site.<\/p>\n<p>The table has no field called <strong>Name<\/strong>. I checked the schema this morning (24 November): 15 fields, and &#8220;Name&#8221; isn&#8217;t one of them. So Airtable answers every one of those writes like this:<\/p>\n<pre><code>HTTP 422\n{\"error\":{\"type\":\"UNKNOWN_FIELD_NAME\",\"message\":\"Unknown field name: \\\"Name\\\"\"}}<\/code><\/pre>\n<p>Two things about that error surprised me when I tested it again today:<\/p>\n<ul>\n<li><strong>One bad field sinks the whole record.<\/strong> I sent three valid fields plus &#8220;Name&#8221;. Airtable created nothing. The four good fields in the script&#8217;s payload get thrown away along with the bad one.<\/li>\n<li><strong><code>typecast: true<\/code> doesn&#8217;t save you.<\/strong> Typecast converts values, like turning text into a select option. It won&#8217;t map a field name that doesn&#8217;t exist.<\/li>\n<\/ul>\n<h2>Why nobody noticed<\/h2>\n<p>The script handles the failure &#8220;politely&#8221;. It prints a warning to stderr, leaves the record ID blank in its output, and still exits 0. The image is fine, the post is fine, the run counts as a success.<\/p>\n<p>The image at the top of this post went through the same script a few minutes before I published it. Same 422, exit code 0, record ID blank.<\/p>\n<p>My agents did see it. The warning shows up in my run logs at least as far back as <strong>9 October<\/strong> (where it already says &#8220;still fails&#8221;), and again on 17 October, 18 October and 22 November. Some runs reported it and moved on, so that image never reached the table. Others added the row with a separate call and moved on. The work-around kept the table mostly filled, and it also kept the bug alive. I wrote about the same trap in <a href=\"https:\/\/jonjones.ai\/ai-automation\/daily-saturday-shortcuts-ai-agent-silent-failure-2026-09-19\/\">3 ways to catch an AI agent silent failure<\/a>. This one slipped through anyway.<\/p>\n<p>The table holds 1,042 rows today. None of them came from this script&#8217;s own logging step, because with &#8220;Name&#8221; in the payload it can&#8217;t create one. So for at least six weeks, the &#8220;log every image at the source&#8221; step has logged nothing. Every row since then got there because an agent wrote it separately.<\/p>\n<h2>The fix: a 10-line schema preflight<\/h2>\n<p>Airtable&#8217;s Meta API lists every table and field in a base. Ask it once, compare against the fields you&#8217;re about to send, and stop loudly if anything is missing:<\/p>\n<pre><code>import json, os, sys, urllib.request\n\nbase, table = os.environ[\"AIRTABLE_BASE_ID\"], os.environ[\"AIRTABLE_TABLE\"]\nreq = urllib.request.Request(\n    f\"https:\/\/api.airtable.com\/v0\/meta\/bases\/{base}\/tables\",\n    headers={\"Authorization\": \"Bearer \" + os.environ[\"AIRTABLE_API_KEY\"]})\ntables = json.load(urllib.request.urlopen(req))[\"tables\"]\nfields = {f[\"name\"] for t in tables if table in (t[\"id\"], t[\"name\"]) for f in t[\"fields\"]}\n\npayload = [\"Image Model\", \"Image URL\", \"Name\", \"Prompt\", \"Site\"]\nmissing = [f for f in payload if f not in fields]\nif missing:\n    sys.exit(f\"Airtable preflight failed, unknown fields: {missing}\")<\/code><\/pre>\n<p>I ran it against my script&#8217;s five fields this morning. It printed <code>unknown fields: ['Name']<\/code> and exited 1. That&#8217;s the line I wanted to see weeks ago.<\/p>\n<p>Three notes if you copy it:<\/p>\n<ol>\n<li><strong>Your token needs the <code>schema.bases:read<\/code> scope.<\/strong> Without it the Meta API refuses, and that&#8217;s a loud failure too, which is fine.<\/li>\n<li><strong>Field names are exact.<\/strong> &#8220;Image URL&#8221; and &#8220;Image Url&#8221; are different fields. Someone renaming a column in the Airtable UI is enough to break an agent that ran fine yesterday.<\/li>\n<li><strong>Treat a 422 as a failure, not a warning.<\/strong> If the write matters enough to make, a rejected write should change the exit code or send an alert.<\/li>\n<\/ol>\n<h2>What I&#8217;m doing about mine<\/h2>\n<p>Changing the script is on my list, not done. It needs two things: drop &#8220;Name&#8221; (or map it to a field that exists), and make a rejected log write show up as a failure. Until then, the agents keep logging images by hand, and now at least the reason is written down in public.<\/p>\n<p>The takeaway: <strong>an agent that writes to a table it has never read is guessing. One schema call turns the guess into a check.<\/strong><\/p>\n<p>If you&#8217;re wiring agents into Airtable, also read <a href=\"https:\/\/jonjones.ai\/ai-automation\/daily-tip-tuesday-airtable-api-update-record-2026-11-03\/\">make your AI agent read before it writes<\/a> and <a href=\"https:\/\/jonjones.ai\/ai-automation\/daily-wednesday-wisdom-api-empty-response-2026-11-11\/\">why an empty result is a claim, not a fact<\/a>. And if you&#8217;d like a second pair of eyes on your own agent pipeline, <a href=\"https:\/\/jonjones.ai\/book-a-meeting\/\">book an automation strategy session<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u500b\u932f\u8aa4\u7684\u6b04\u4f4d\u540d\u7a31\u6703\u5c0e\u81f4 Airtable \u62d2\u7d55\u6574\u7b46\u8a18\u9304\uff0c\u578b\u5225\u8f49\u63db\u4e5f\u7121\u6cd5\u5132\u5b58\u3002\u6211\u7684\u5716\u50cf\u8173\u672c\u5df2\u7d93\u9019\u6a23\u5931\u6557\u597d\u5e7e\u9031\u4e86\uff0c\u4f46\u9000\u51fa\u7a0b\u5f0f\u78bc\u4ecd\u7136\u662f 0\u3002\u4ee5\u4e0b\u662f\u6355\u7372\u6b64\u554f\u984c\u7684 10 \u884c schema \u9810\u6aa2\u7a0b\u5f0f\u78bc\u3002.<\/p>","protected":false},"author":2,"featured_media":8120,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[44],"tags":[],"class_list":["post-8121","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-automation"],"taxonomy_info":{"category":[{"value":44,"label":"AI Automation"}]},"featured_image_src_large":["https:\/\/jonjones.ai\/wp-content\/uploads\/2026\/11\/daily-tip-tuesday-airtable-unknown-field-name-20261124.jpg",1344,752,false],"author_info":{"display_name":"Jon Jones","author_link":"https:\/\/jonjones.ai\/zh\/author\/jonjonjones-ai\/"},"comment_info":0,"category_info":[{"term_id":44,"name":"AI Automation","slug":"ai-automation","term_group":0,"term_taxonomy_id":44,"taxonomy":"category","description":"","parent":0,"count":291,"filter":"raw","cat_ID":44,"category_count":291,"category_description":"","cat_name":"AI Automation","category_nicename":"ai-automation","category_parent":0}],"tag_info":false,"_links":{"self":[{"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/posts\/8121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/comments?post=8121"}],"version-history":[{"count":0,"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/posts\/8121\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/media\/8120"}],"wp:attachment":[{"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/media?parent=8121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/categories?post=8121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jonjones.ai\/zh\/wp-json\/wp\/v2\/tags?post=8121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}