The mapping step is where source columns become target fields. Good mappings are accurate, robust to slightly-different source variants, and contain enough transforms to turn raw input into clean data.
How to Map
- Open the routine and click Mapping.
- Each source column appears with a “Maps to” dropdown of target fields.
- Pick the target. Some mappings are auto-suggested by name similarity.
- Optionally add a transform pipeline (per column or per row).
- Mark required source columns — if missing in a future file, the import is aborted.
Useful Transforms
- Trim whitespace — removes accidental spaces around values.
- Case conversion — lowercase for emails, upper for codes.
- Date parsing — specify input format (DD/MM/YYYY, MM/DD/YYYY, ISO).
- Number parsing — handle thousand separators and decimal points by locale.
- Lookup — replace a value via a lookup table (e.g. country code → country name).
- Default if blank — provide a fallback for missing values.
- Custom function — PHP snippet for anything else.
Handling Variant Files
Real suppliers occasionally rename columns or change layout. Make mappings tolerant:
- Match column names case-insensitively.
- Accept alias names (e.g. “Email” or “E-mail” or “Email Address” all map to
email). - Ignore unknown extra columns rather than erroring.
Worked Examples
- Customer import: Map “Cust Name” → name, “EMAIL” → email (lowercase + trim), “Sign-up Date” → signed_up_at (parse DD/MM/YYYY).
- Product feed: Map “SKU” → sku (upper-case), “PRICE (USD)” → price_usd (number with comma separator), “Country” → country (lookup table converting full names to ISO codes).
- Bulk address import: Map source columns plus a custom transform that splits “London, UK” into city and country.