Prompt
How do I normalize customer fields across systems?
Latest observation
To normalize customer fields across systems, you want to create a canonical customer model and map every source system into it.
1) Define the canonical schema
Pick one standard format for your organization, for example:
customer_idfirst_namelast_namefull_nameemailphoneaddress_line1address_line2citystatepostal_codecountrydate_of_birthcreated_atupdated_at
This becomes the “source of truth” structure that all systems conform to.
2) Build field mappings
For each source system, create a mapping table that says how its fields translate into the canonical model.
Example:
| System A field | Canonical field | Transformation |
|---|---|---|
cust_id | customer_id | direct copy |
fname | first_name | trim, proper case |
lname | last_name | trim, proper case |
email_addr | email | lower-case, validate |
zip | postal_code | normalize to standard format |
3) Standardize formats
Apply consistent rules across all inputs:
- Names: trim whitespace, remove extra spaces, standardize case
- Emails: lowercase, validate syntax
- Phones: normalize to E.164 if possible
- Addresses: standardize abbreviations, country-specific formatting
- Dates: convert to ISO 8601 (
YYYY-MM-DD) - Country/state codes: use ISO codes where possible
4) Clean and validate data
Add validation rules to catch bad data before it enters the canonical layer:
- required fields present
- valid email/phone formats
- postal code matches country
- no invalid characters
- type checks for dates/numbers
5) Handle duplicates and identity
Customers often appear in multiple systems. Use matching rules to link records:
- exact match on email + phone
- fuzzy match on name + address
- assign a master customer ID
- maintain cross-reference IDs from each source system
6) Use transformation pipelines
Implement normalization in ETL/ELT or middleware:
- ingest raw data
- transform to canonical schema
- validate
- deduplicate
- load into master customer store / CRM / warehouse
7) Version your schema
Fields change over time. Keep schema versions and mapping documentation so updates don’t break downstream systems.
8) Document ownership and rules
Define:
- which system is authoritative for each field
- merge/conflict resolution rules
- how nulls and overrides are handled
Practical example
System A:
{
"cust_id": "123",
"fname": " jane ",
"lname": "doe",
"email_addr": "Jane.Doe@EXAMPLE.com",
"phone_num": "(415) 555-1234"
}
Normalized:
{
"customer_id": "123",
"first_name": "Jane",
"last_name": "Doe",
"email": "jane.doe@example.com",
"phone": "+14155551234"
}
If you want, I can also provide:
- a customer field normalization template,
- SQL/Python examples, or
- a mapping strategy for CRM + ERP + support systems.