Build a tool
Start on one page—typed tables, tested rules, a form to add rows, and buttons to update them—then split into records.ki and job pages when multiple workflows share the same data.
1. Tables and tested rules
Give columns explicit types so invalid edits are caught immediately. Mark (Id |> key) on rows referenced by buttons, and (:email Customer |> owner) on rows scoped to a signed-in person (doc/share.ki):
> usd = format.money "USD"
> menu = |Item Price|
Sandwich tray $85.00
Pastry box $40.00
Coffee for twenty $60.00
> orders = |Id Customer :date Day Item :int Qty :bool Delivered|
o1 ana@example.com 2026-11-10 Sandwich tray 2 —
o2 ben@example.com 2026-11-12 Coffee for twenty 1 —
o3 ana@example.com 2026-11-03 Pastry box 3 ✓
Keep pricing and status formulas beside the tables, pin them with =>, and join shared views once:
> delivery-fee = 25
> order-total = fn :decimal price :int qty -> price * qty + delivery-fee
> order-total 85 2 => 195 ✓
> priced = orders
|> lookup menu Item
|> extend Total = (order-total (Price or-else 0) Qty |> usd)
> priced
Id Customer Day Item Qty Delivered Price Total
o1 ana@example.com 2026-11-10 Sandwich tray 2 false $85.00 $195.00 o2 ben@example.com 2026-11-12 Coffee for twenty 1 false $60.00 $85.00 o3 ana@example.com 2026-11-03 Pastry box 3 true $40.00 $145.00
2. Forms and row actions
Define state inputs, place them with field (in a row, col, or grid), and pass table.insert to a button. Omit the key column (Id) so Kiki generates a unique key automatically—try adding an order below:
> item = state ((choice menu.Item) menu.0.Item)
> qty = state 1
> day = state 2026-11-14
> customer = state cleo@example.com
> grid 2 [
(field "Item" item)
(field "Quantity" qty)
(field "Delivery day" day)
(field "Customer" customer)]
> enabled (qty > 0) "Order at least one."
(tag "primary" (button "Add order" (table.insert orders [
{Customer = customer Day = day Item = item Qty = qty Delivered = false}])))
To act on an existing row, project a button column in select calling table.update or table.delete:
> deliver = fn id -> table.update orders (orders |> filter Id == id) {Delivered = true}
> priced
|> filter not Delivered
|> select Day Customer Item Qty Total
Action = (button "Mark delivered" (deliver Id))
Day Customer Item Qty Total Action
2026-11-10 ana@example.com Sandwich tray 2 $195.00 Mark delivered 2026-11-12 ben@example.com Coffee for twenty 1 $85.00 Mark delivered
Source columns also stay directly editable through filter, sort, select, and lookup, and any table can display as a kanban board (view.board) or calendar (view.calendar) (doc/table.ki).
3. Metrics and tool mode
Lead the page with metric cards showing what needs action today, and add > set view = 'tool at the top so prose is locked against stray edits while forms, buttons, and table cells stay live:
> open = priced |> filter not Delivered
> grid 2 [
(metric "To deliver" (~ \(length open)))
(metric "Open total" (open |> aggregate sum Total |> usd))]
To deliver
2
Open total
$280.00
4. Split into a multi-page tool
When distinct jobs or roles share data, organize the tool as a folder over records.ki:
catering/
index.ki front page: headline metrics and links to each job
records.ki exported tables, formats, and => tested rules
orders.ki job page: take orders and mark deliveries
invoices.ki job page: bill delivered orders
data/ CSV exports or .xlsx files dropped in over time
• One records.ki: export shared tables, formats, and rules from records.ki. Job pages import "./records" and never import one another.
• One job per page: Start each job page with > set view = 'tool and open sibling pages from index.ki with button "Orders" (files.open "./orders.ki") (title breadcrumbs link back to index.ki automatically).
• Relative ./ paths: Always write ./records, ./orders.ki, and ./data/... so renaming or copying the folder (files.copy "./" "catering") keeps every link working.
Common patterns
• Build with @AI: Describe your workflow on an @AI line—AI generates this records.ki + job-page layout inside a draft you can test before applying (doc/ai.ki).
• CSV folders & Excel: Drop an .xlsx workbook in to generate a typed .ki module, or load every .csv in ./data/ reactively with files.list and read-table (demo/roaster/import.ki).
• Header + line items: Generate one key with id = table.new-key inside a function and return [(table.insert headers [...]) (table.insert lines [...])] (demo/foodbank/stock.ki).
• Personalized email: Import std/mail to preview (mail.preview) and send (mail.send-new) emails from any query (std/mail.ki).
Where next
• doc/ui.ki — state controls, required validation, confirm, and layouts
• doc/table.ki — key, owner, column controls, boards, and calendars
• doc/share.ki — public forms, workspace roles, and :own row permissions
• demo/studio/index.ki — complete multi-page workspace to explore and copy