Data Mapping and Transformation
Master the art of transforming lead data between sources and recipients. Learn field mapping, data transformation, and standardization techniques for seamless data flow.
π You Are Here
You're learning how to map and transform data as it flows through LeadConduit. Proper mapping ensures data arrives at destinations in the correct format, with the right field names, and properly validated.
π― What You'll Master
- Field mapping fundamentals
- Data transformation techniques
- Value standardization
- Complex mapping scenarios
- Troubleshooting mapping issues
πΊοΈ Understanding Mappings
What Are Mappings?
Mappings connect data between systems:
- Source Fields β LeadConduit Fields β Recipient Fields
- Transform formats (phone: 555-1234 β 5551234)
- Standardize values (California β CA)
- Combine/split fields
- Apply business logic
Why Mappings Matter
Without Proper Mapping:
- β Data arrives in wrong format
- β Required fields missing
- β Integration failures
- β Manual data cleanup
With Proper Mapping:
- β Automatic format conversion
- β Consistent data quality
- β Seamless integrations
- β Zero manual intervention
π§ Basic Mapping Concepts
Direct Mapping
Simple one-to-one field connections:
Source Field β Destination Field
βββββββββββββββββββββββββββββββββββββ
email β email_address
phone β contact_phone
first_name β fname
last_name β lname
Field Naming Strategies
Source Variations:
Common Email Field Names:
- email
- email_address
- emailAddress
- Email
- contact_email
- primary_email
Standardize in LeadConduit:
All map to β email
Data Types
Ensure compatible types:
- String β String
- Number β Number or String
- Boolean β Boolean, 1/0, yes/no
- Date β Various formats
π Transformation Techniques
Format Transformations
Phone Formatting:
Input: (555) 123-4567
Output: 5551234567
Input: 555.123.4567
Output: 5551234567
Input: +1-555-123-4567
Output: 5551234567
Date Formatting:
Input: 2024-01-15T10:30:00Z
Output: 01/15/2024
Input: January 15, 2024
Output: 2024-01-15
Value Standardization
State Codes:
Input: California, CALIFORNIA, Calif., CA
Output: CA
Input: New York, NEW YORK, N.Y., NY
Output: NY
Boolean Values:
Input: true, True, TRUE, 1, yes, Yes
Output: true
Input: false, False, FALSE, 0, no, No
Output: false
String Manipulation
Concatenation:
first_name: John
last_name: Doe
full_name: {first_name} {last_name} β "John Doe"
Extraction:
full_email: john.doe@example.com
username: {full_email.split('@')[0]} β "john.doe"
domain: {full_email.split('@')[1]} β "example.com"
Case Conversion:
Input: JOHN DOE
Output: John Doe (Title Case)
Input: john doe
Output: JOHN DOE (Upper Case)
π Advanced Mapping Patterns
Conditional Mapping
Map based on conditions:
// Map lead type based on source
if (source == "Facebook") {
lead_type = "Social"
} else if (source == "Google") {
lead_type = "Search"
} else {
lead_type = "Direct"
}
// Map priority based on state
if (state in ["CA", "TX", "FL"]) {
priority = "High"
} else {
priority = "Normal"
}
Calculated Fields
Create new fields from existing data:
// Calculate age from birthdate
age = current_year - birth_year
// Score calculation
lead_score = (email_valid * 25) +
(phone_valid * 25) +
(state_matches * 50)
// Revenue estimation
estimated_value = base_value * conversion_rate * quality_score
Multi-Field Mapping
Combine multiple fields:
// Address compilation
full_address = {street} + ", " + {city} + ", " + {state} + " " + {zip}
// Phone preference
best_phone = {mobile_phone} || {work_phone} || {home_phone}
// Name formatting
display_name = {prefix} + " " + {first_name} + " " + {last_name} + " " + {suffix}
π― Mapping Configuration
Source Mapping
Configure how incoming data maps to LeadConduit:
Source Configuration:
Field Mappings:
- Source: "EmailAddress"
LeadConduit: "email"
Required: true
- Source: "PhoneNumber"
LeadConduit: "phone_1"
Transform: "digits_only"
- Source: "FirstName"
LeadConduit: "first_name"
Transform: "title_case"
Recipient Mapping
Configure outbound field mapping:
Recipient Configuration:
Field Mappings:
- LeadConduit: "email"
Destination: "contact_email"
- LeadConduit: "phone_1"
Destination: "primary_phone"
Format: "+1{value}"
- LeadConduit: "state"
Destination: "mailing_state_code"
Transform: "uppercase"
π Common Mapping Scenarios
E-commerce Lead Mapping
// Source Fields β LeadConduit β Shopify
email β email β customer_email
phone β phone_1 β customer_phone
cart_value β purchase_amount β total_spent
items β product_interest β tags
Real Estate Lead Mapping
// Zillow β LeadConduit β CRM
property_interest β property_type β lead_property_type
price_range β budget β estimated_budget
timeline β purchase_timeline β urgency_score
area β target_location β search_area
Insurance Lead Mapping
// Form β LeadConduit β Carrier
dob β birth_date β applicant_age (calculated)
coverage_amount β requested_coverage β policy_amount
health_conditions β medical_history β risk_category
smoker β tobacco_use β rate_class
π§ Troubleshooting Mappings
"Field Not Mapped"
Symptoms: Data missing at destination
Check:
- Source field name exact match
- Mapping configuration saved
- Field contains data
- No typos in field names
"Invalid Format"
Symptoms: Data rejected by recipient
Solutions:
- Add format transformation
- Verify expected format
- Check data type compatibility
- Test with sample data
"Mapping Not Working"
Debug Steps:
- Check Events for raw data
- Verify field appears in flow
- Test transformation logic
- Review recipient requirements
π‘ Best Practices
Naming Conventions
Use Clear Names:
Good:
- email_address
- mobile_phone
- purchase_date
Bad:
- field1
- data
- misc
Documentation
Document Complex Mappings:
// Map timezone based on state
// Uses ET for eastern states, CT for central, etc.
// Default to PT if state unknown
timezone = state_to_timezone_map[state] || "PT"
Validation
Validate Before Mapping:
- Check data exists
- Verify format
- Ensure type compatibility
- Handle edge cases
Performance
Optimize Transformations:
- Cache repeated calculations
- Minimize complex operations
- Use built-in functions
- Batch similar transformations
π Mapping Patterns Library
Phone Number Patterns
// Remove all non-digits
phone.replace(/\D/g, '')
// Format as (XXX) XXX-XXXX
phone.replace(/(\d{3})(\d{3})(\d{4})/, '($1) $2-$3')
// Add country code
'+1' + phone
Email Patterns
// Lowercase all emails
email.toLowerCase()
// Extract domain
email.split('@')[1]
// Validate format
/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)
Name Patterns
// Title case
name.replace(/\w\S*/g, txt =>
txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
)
// Remove extra spaces
name.trim().replace(/\s+/g, ' ')
// Extract initials
name.split(' ').map(n => n[0]).join('')
π Mapping Checklist
Before activating flow:
- All required fields mapped
- Transformations tested
- Edge cases handled
- Documentation added
- Sample data validates
- Recipient format confirmed
- Error handling configured
- Performance acceptable
π Related Documentation
- Field Configuration - Field setup and validation
- Types Reference - Data type details
- Mappings Reference - Technical specifications
π Mapping Mastery: Proper data mapping is the bridge between systems. Take time to understand requirements, test thoroughly, and document complex transformations for maintainable integrations!
Comments
0 comments
Please sign in to leave a comment.