CSV Column Mapping in React Without Building a Mapping UI
Your application expects:
firstName lastName email company
Your customer uploads:
Given Name Surname Email Address Employer
Technically, both schemas describe the same data.
Your parser does not know that.
That is why a real CSV importer needs a column-mapping step between “read the spreadsheet” and “insert the rows.”
Why column mapping exists
You cannot reasonably require every customer to rename their spreadsheet columns to match your internal field names.
Real spreadsheets use whatever terminology made sense to the person who created them:
- First Name
- First
- Given Name
- Contact First Name
- Customer First
All five may need to map to one field: firstName.
A useful importer should make that relationship obvious to the person uploading the file.
For example:
| Uploaded column | Your application |
|---|---|
| Given Name | First name |
| Surname | Last name |
| Email Address | |
| Employer | Company |
The customer confirms the mapping, fixes anything ambiguous, and continues.
Header auto-detection should help, not take control
Automatic mapping is useful when the answer is obvious.
It becomes irritating when software silently guesses wrong.
Bootstrapware Importer proposes mappings based on uploaded headers while keeping the user in control of the final result. Headers and field labels are normalized for matching; users can override any field or leave it unmapped.
The goal is not “AI magically understands every spreadsheet.”
The goal is: obvious mappings happen automatically; ambiguous mappings take one click to fix.
That is usually enough.
Define your application fields once
Your importer configuration describes the shape you want:
[
{ key: "firstName", label: "First name", type: "string", required: true },
{ key: "lastName", label: "Last name", type: "string", required: true },
{ key: "email", label: "Email", type: "email", required: true },
{ key: "company", label: "Company", type: "string" },
]The spreadsheet does not need to use those keys.
The mapping layer is what translates customer vocabulary into application vocabulary.
Mapping is where a parser turns into a product
Parsing CSV is commodity work.
Mapping is one of the places where a customer actually experiences your import flow.
A good mapping UI needs to make several states obvious:
- Which required fields are mapped?
- Which uploaded columns are unused?
- Which application fields are still missing? (Bootstrapware blocks preview until required fields are mapped.)
- What happens to columns your application does not care about?
- Can the user go back and change the mapping after seeing validation errors?
Those are not difficult problems individually.
They are just another subsystem you now own forever.
Bootstrapware exists because your coding agent can probably build this too. You still have a product of your own to ship.
Related: Importer · Column mapping · Validation · React guide · Handle invalid CSV rows