Field Mapping
Field mapping defines how data flows between your connected systems. This guide covers the different mapping types, transformations, and best practices.
Mapping Basics
Section titled “Mapping Basics”When you create a sync between two systems, you need to tell Sync or Swim which fields in System A correspond to which fields in System B.
Mapping Types
Section titled “Mapping Types”Direct Mapping
Section titled “Direct Mapping”The simplest type - one field maps directly to another:
| Source Field | Target Field | Notes |
|---|---|---|
first_name | FirstName | Direct 1:1 mapping |
email | Email | Same data, different names |
Computed Fields
Section titled “Computed Fields”Combine or transform fields during sync:
Combine multiple source fields into one target field:
Source: first_name + " " + last_nameTarget: Full_Name__c
Result: "John" + " " + "Doe" → "John Doe"Extract part of a field value:
Source: email (extract domain)Target: Email_Domain__c
Result: "john@acme.com" → "acme.com"Default Values
Section titled “Default Values”Set a value when the source field is empty:
Source: priority (nullable)Target: Priority__cDefault: "Normal"
Result: NULL → "Normal"Lookup/Reference Fields
Section titled “Lookup/Reference Fields”Map relationships between records:
Type Conversions
Section titled “Type Conversions”Sync or Swim automatically handles common type conversions:
| Source Type | Target Type | Conversion |
|---|---|---|
string | string | Direct |
integer | number | Direct |
timestamp | datetime | Timezone-aware |
boolean | checkbox | true/false → checked/unchecked |
decimal | currency | Precision preserved |
text[] | multipicklist | Array to semicolon-separated |
Date/Time Handling
Section titled “Date/Time Handling”Date and time fields require special attention:
- Timestamps are converted to the target system’s timezone
- Date-only fields strip time components
- Time-only fields strip date components
Filtering
Section titled “Filtering”Control which records sync based on conditions:
Include Filters
Section titled “Include Filters”Only sync records that match:
WHERE status = 'active'AND created_at > '2024-01-01'Exclude Filters
Section titled “Exclude Filters”Skip records that match:
WHERE type != 'internal'AND is_test != trueBi-directional Filters
Section titled “Bi-directional Filters”Filters apply in both directions. A record excluded from sync:
- Won’t be created in the target system
- Won’t be updated if it changes
- Won’t be deleted if removed from source
Best Practices
Section titled “Best Practices”1. Map Required Fields First
Section titled “1. Map Required Fields First”Ensure all required fields in the target system have mappings before enabling sync.
2. Handle Nulls Explicitly
Section titled “2. Handle Nulls Explicitly”Decide how null/empty values should behave:
- Skip - Don’t update target if source is null
- Clear - Set target to null/empty
- Default - Use a default value
3. Test with Sample Data
Section titled “3. Test with Sample Data”Before syncing production data:
- Create a few test records
- Verify mappings work as expected
- Check computed fields calculate correctly
- Validate lookup relationships resolve
4. Document Custom Logic
Section titled “4. Document Custom Logic”If you use complex transformations, document:
- What the transformation does
- Why it’s needed
- Example input/output values
Common Patterns
Section titled “Common Patterns”Syncing Names
Section titled “Syncing Names”PostgreSQL → Salesforce:
first_name → FirstNamelast_name → LastNameOr combined:
first_name + ' ' + last_name → NameSyncing Addresses
Section titled “Syncing Addresses”Map structured address fields:
street_address → BillingStreetcity → BillingCitystate → BillingStatepostal_code → BillingPostalCodecountry → BillingCountrySyncing Status Fields
Section titled “Syncing Status Fields”Map enums/picklists with value translation:
Source: 'new', 'in_progress', 'done'Target: 'New', 'In Progress', 'Completed'Troubleshooting
Section titled “Troubleshooting”Field Not Syncing
Section titled “Field Not Syncing”- Check the field is included in your mapping
- Verify the source field has data
- Check for type conversion errors in logs
- Ensure the target field is writable
Wrong Values
Section titled “Wrong Values”- Check for type mismatches
- Review any transformations applied
- Verify timezone handling for dates
- Check for encoding issues with special characters
Lookup Failures
Section titled “Lookup Failures”- Ensure the referenced record exists
- Verify the external ID field is mapped
- Check the lookup field configuration
- Review dependency ordering
Next Steps
Section titled “Next Steps”- Sync Modes - Configure how records are matched
- Architecture Overview - Understand the sync process