CSV Import
Bring spreadsheet data into the product with column mapping, row-level validation and a preview, so nothing is imported by surprise.
7 states6 edge casesDesktop + Mobile
01The problem
New customers arrive with their data in spreadsheets, and every spreadsheet is different: column names, date formats, duplicates, blank rows. An import that guesses silently creates hundreds of bad records that are harder to clean up than the original file. One that rejects the whole file over a single bad row stalls onboarding.
02When to use
Use when
- Onboarding customers migrating from spreadsheets or another tool
- Bulk creating records: contacts, products, transactions
- Periodic updates from systems without an integration
Avoid when
- A direct integration exists for the source system — offer it first.
- Fewer than ~10 records — a fast manual form or paste is easier.
03Recommended UX
Statecraft recommendation
Make import a four-step flow — upload, map columns, review, import — with automatic mapping the user confirms, validation per row before anything is written, and the choice to import valid rows while downloading the invalid ones to fix.
04Desktop behaviour
On desktop, the mapping step is a two-column table: file columns on the left with sample values, product fields on the right.
Desktop rules
- Show 2–3 sample values per column so users can recognise the data, not just the header.
- Mark required fields; block continuing until each is mapped.
- Let users skip columns explicitly (“Don’t import”).
- Review step shows counts first, with errors grouped by type and expandable to rows.
05Mobile behaviour
Large imports are a desktop task. On mobile, support small imports and monitoring an import started elsewhere.
Mobile rules
3 mobile rules are included in Pro.
Statecraft Pro
Unlock the full pattern
Get the complete interaction flow, states, edge cases, mobile rules and implementation prompt.
- Interaction flow · 5 steps
- 3 mobile rules
- 7 states
- 6 edge cases with recommendations
- 4 microcopy comparisons
- Accessibility notes
- Developer notes
- Claude Code / Codex implementation prompt
- React + TypeScript reference code and tests
Edge cases covered in this pattern
- Duplicate records
- Ambiguous dates
- Encoding problems
- Huge file
- Import was a mistake
- Formulas and leading equals signs