Email Import (Gmail → Coda AI → Items + Kanban Loops)
What’s on this page
Email Import Runs: one row per scan (query + lookback + counts) Email Order Inbox: ingested Gmail messages + AI classification + extracted JSON Email Order Lines: normalized line items (each row = one purchased item) Email Purchase Patterns: per-item aggregation → recommends NPK + Planned Quickstart (recommended)
Connect Gmail Pack (Coda sidebar → Packs → Gmail → connect account). Create a row in Email Import Runs: Run ID: e.g. 2025-12-31-001 Gmail Query (starter): newer_than:365d (subject:(order OR "order confirmation" OR "purchase order") OR "thank you for your order" OR "order total") Use Gmail Pack to pull messages matching the query into Email Order Inbox (populate: Message ID, Date, From, Subject, Snippet, Body). Run AI columns on Inbox rows: Extracted Order JSON (AI) Convert JSON → Email Order Lines (one row per extracted line). Match line items to Arda items (Matched Item) and mark Approved. Populate Email Purchase Patterns and apply recommendations into Kanban Loops. AI prompt templates (paste into Coda AI column settings)
A) Is Order? (AI)
You are classifying whether an email represents a purchase event that should affect inventory planning.
Return ONLY one token: ORDER, NOT_ORDER, or UNCERTAIN.
ORDER includes: purchase order, order confirmation, invoice/receipt for purchased goods.
NOT_ORDER includes: shipping updates, marketing, newsletters, password resets.
B) Extracted Order JSON (AI)
Extract a purchasing record from this email.
Return VALID JSON only (no markdown). If not an order, return {“isOrder”: false}.
If it is an order, return:
{
“isOrder”: true,
“orderNumber”: “string|null”,
“orderDate”: “YYYY-MM-DD|null”,
“supplierName”: “string|null”,
“supplierEmail”: “string|null”,
“currency”: “string|null”,
“lines”: [
{“name”:“string|null”,“sku”:“string|null”,“quantity”:number|null,“unit”:“string|null”,“unitPrice”:number|null}
]
}
Notes / constraints
The MCP API can’t create Coda button columns reliably here, so Apply to Kanban Loop is currently a toggle. If you want, I can add a real button in the doc UI pattern later (or we can add a dedicated automation).
Extracted Order JSON (AI)
Typical Qty (Mode/Median)
1. Get started:
2. Sync your Gmail threads.
Expand to see Gmail threads (defaults to last 7 days) 3. Sync your Gmail messages.
Expand to see individual Gmail messages (defaults to last 7 days) Individual Gmail messages
4. Explore 3 quickstart templates:
5. Create your own doc.
Click Insert in the top right of the toolbar, then type Gmail in the search bar to install the pack in a new doc.