What is Field Mapping?
Field mapping defines the relationship between your Webflow CSV columns and Sanity document fields. It tells MigrateKit:- What each column represents (title, body, image, etc.)
- How to transform the data (HTML → Portable Text, URL → image)
- Where to put it in your Sanity schema (field names)
1
Analyze CSV Structure
MigrateKit reads your CSV headers and sample data to understand what you have
2
Suggest Mappings
Based on column names and data types, MigrateKit suggests appropriate Sanity field types
3
You Review & Adjust
Accept suggestions or manually configure mappings for each field
4
Validate
MigrateKit checks that all mappings are valid before allowing import
Auto-Mapping Intelligence
MigrateKit uses pattern matching to suggest mappings:Name-Based Matching
| Webflow Column | Detected As | Suggested Type |
|---|---|---|
| Name, Title, Heading | Title field | string |
| Slug, URL Slug | URL identifier | slug |
| Post Body, Content, Rich Text | Rich content | portableText |
| Main Image, Hero Image, Thumbnail | Primary image | image |
| Published Date, Date Published | Publication date | datetime |
| Featured, Active, Published | Toggle field | boolean |
Data-Based Detection
MigrateKit also inspects sample values:- ISO dates (
2024-01-15T10:30:00.000Z) →datetime - URLs (
https://...) →urlorimage - Numbers (
100,3.14) →number - True/false (
true,false,yes,no) →boolean - HTML tags (
<p>,<h2>) →portableText
Transformation Pipeline
When you map a field, MigrateKit applies transformations during import:String Fields
- Trim whitespace
- Remove null bytes
- Preserve Unicode
Portable Text
- Parse HTML structure
- Map tags to blocks
- Extract inline formatting
- Create Portable Text JSON
Image Fields
- Validate URL format
- Download from source
- Check for duplicates
- Upload to Sanity
- Create asset reference
Slug Fields
- Lowercase value
- Remove special characters
- Replace spaces with hyphens
- Create slug object:
{current: "value"}
Date/Time Fields
- Parse various formats:
- ISO 8601:
2024-01-15T10:30:00.000Z - Simple date:
2024-01-15 - US format:
01/15/2024(if unambiguous)
- ISO 8601:
- Convert to ISO format
- Validate range (1900-2100)
Number Fields
- Parse as float or integer
- Handle separators (
,1,000→1000) - Validate numeric
- Preserve decimal precision
Boolean Fields
Convert various representations:| CSV Value | Boolean |
|---|---|
true, True, TRUE | true |
false, False, FALSE | false |
yes, Yes, YES, 1 | true |
no, No, NO, 0 | false |
Validation Rules
MigrateKit validates mappings before import:Schema Validation
- Document type - Valid Sanity identifier (no spaces, special chars)
- Field names - Unique, valid identifiers
- Required fields - Must have mappings
Data Validation
- Type compatibility - CSV values can convert to target type
- Required data - Required fields have values in CSV
- Format validity - Dates parse, URLs are valid, etc.
Preview Validation
Sample documents show you exactly what will be imported:Common Mapping Patterns
Basic Blog Post
| Webflow Column | Sanity Field | Type |
|---|---|---|
| Name | title | string |
| Slug | slug | slug |
| Post Body | content | portableText |
| Main Image | coverImage | image |
| Published Date | publishedAt | datetime |
| Featured | featured | boolean |
E-commerce Product
| Webflow Column | Sanity Field | Type |
|---|---|---|
| Name | title | string |
| Slug | slug | slug |
| Description | description | portableText |
| Price | price | number |
| Product Image | images | array of image |
| In Stock | inStock | boolean |
Author/Person
| Webflow Column | Sanity Field | Type |
|---|---|---|
| Name | name | string |
| Slug | slug | slug |
| Bio | bio | portableText |
| Photo | photo | image |
string | ||
| Twitter Handle | string |
Advanced Mapping
Arrays
Map comma-separated values to arrays: CSV:- Field type:
array - Item type:
string
Nested Objects
While MigrateKit doesn’t support complex nested mappings in MVP, you can:- Import flat data
- Manually restructure in Sanity Studio
- Or use Sanity’s GROQ projections after import
Best Practices
Use descriptive field names
Use descriptive field names
Choose names that clearly indicate content:
- ✅
coverImage,heroImage - ❌
img,pic1,image-main
Follow Sanity conventions
Follow Sanity conventions
Use camelCase for field names:
- ✅
publishedAt,authorName - ❌
published_at,author-name
Map selectively
Map selectively
You don’t have to map every column:
- Skip Webflow system fields (
Collection ID,Item ID) - Skip deprecated or unused fields
- Skip fields you’ll add manually later
Plan for references
Plan for references
If columns reference other collections:
- Note the relationship
- Map as
stringfor now (stores the ID/slug) - Manually recreate references in Sanity after import
Test with preview
Test with preview
Always review sample documents before importing:
- Check Portable Text renders correctly
- Verify dates parse properly
- Confirm images reference correctly
Troubleshooting
'Field type mismatch' error
'Field type mismatch' error
Cause: Data in column doesn’t match selected field type.Example: Mapping text column to
number field.Fix:- Choose correct field type for the data
- OR clean data in CSV before upload
'Required field has empty values'
'Required field has empty values'
Cause: Some rows are missing data for a required field.Fix:
- Make field optional (uncheck “Required”)
- OR fill missing values in CSV
- OR accept that rows with missing data will fail
Auto-mapping got it wrong
Auto-mapping got it wrong
Cause: Column name or data pattern was ambiguous.Fix: Manually adjust the mapping—auto-suggestions are just starting points.
Can't map reference fields
Can't map reference fields
Current limitation: Reference fields aren’t supported in MVP.Workaround:
- Map as
stringto preserve the ID/slug - Manually link references in Sanity Studio after import