Contact details helper flow
Note
This flow is self-documenting and should be viewed within Salesforce (Setup > Process Automations > Flows). This document is to support working through a visual flow. Please note: the flow commentary is produced using AI.
Overview#
Flow name: MoveData_Donation_Helper_Set_Contact_Details Label: [MoveData] Donation: Helper - Set Contact Details Type: Auto-Launched Flow Template API version: 60.0 Status: Active
This comprehensive helper flow handles the transformation and validation of contact data from external platforms, with sophisticated data quality controls, field formatting, and address processing capabilities.
Purpose#
The flow provides complete contact data processing that:
- Validates and formats contact names with case transformation
- Handles phone number formatting and type classification
- Processes email addresses with type-specific mapping
- Implements sophisticated address quality scoring and validation
- Supports both Mailing and Other address field sets
- Includes protection mechanisms to preserve existing data
Salesforce fields#
This flow interacts with the Salesforce Contact object and its related fields. Below is a mapping of all fields utilised:
| Field API name | Field type | Purpose in flow |
|---|---|---|
| Id | ID | Unique record identifier |
| FirstName | Text (40) | Contact's first name |
| LastName | Text (80) | Contact's last name (required field) |
| Salutation | Picklist | Contact's title/salutation |
| Birthdate | Date | Contact's birth date |
| Email (80) | Primary email address | |
| Phone | Phone (40) | Primary phone number |
| HomePhone | Phone (40) | Home phone number |
| MobilePhone | Phone (40) | Mobile phone number |
| MailingStreet | Textarea (255) | Street address for mailing |
| MailingCity | Text (40) | City for mailing address |
| MailingState | Text (80) | State/Province for mailing address |
| MailingCountry | Text (80) | Country for mailing address |
| MailingPostalCode | Text (20) | Postal/ZIP code for mailing address |
| OtherStreet | Textarea (255) | Alternative street address |
| OtherCity | Text (40) | Alternative city address |
| OtherState | Text (80) | Alternative state/province address |
| OtherCountry | Text (80) | Alternative country address |
| OtherPostalCode | Text (20) | Alternative postal/ZIP code |
| npe01__HomeEmail__c | Email (80) | Home email address (NPSP field) |
| npe01__WorkEmail__c | Email (80) | Work email address (NPSP field) |
Input variables#
Core contact data#
| Variable | Type | Required | Description |
|---|---|---|---|
Record |
Contact SObject | Yes | The Contact record being processed |
Salutation |
String | No | Contact salutation/title |
FirstName |
String | No | Contact's first name |
LastName |
String | No | Contact's last name |
Birthday |
Date | No | Contact's birth date |
Email |
String | No | Contact's email address |
EmailType |
String | No | Email type classification (work/home) |
Phone |
String | No | Contact's phone number |
PhoneType |
String | No | Phone type classification (mobile/work/home) |
Address data#
| Variable | Type | Description |
|---|---|---|
MailingAddress_Street |
String | Street address |
MailingAddress_City |
String | City |
MailingAddress_State |
String | State/Province |
MailingAddress_StateCode |
String | State/Province code |
MailingAddress_Country |
String | Country |
MailingAddress_CountryCode |
String | Country code |
MailingAddress_Postcode |
String | Postal/ZIP code |
MailingAddress_QualityIndex |
Number | Data quality score (0-100) |
Use_Mailing_Address |
Boolean | Use mailing vs. other address fields (Default: true) |
Configuration variables#
Name processing#
| Variable | Type | Default | Description |
|---|---|---|---|
Config_ContactIgnoreFirstName |
Boolean | false | Skip first name processing |
Config_ContactIgnoreLastName |
Boolean | false | Skip last name processing |
Config_ContactIgnoreSalutation |
Boolean | false | Skip salutation processing |
Config_ContactNameFirstCase |
Number | 0 | First name case transformation |
Config_ContactNameLastCase |
Number | 0 | Last name case transformation |
Communication processing#
| Variable | Type | Default | Description |
|---|---|---|---|
Config_ContactIgnoreEmail |
Boolean | - | Skip email processing |
Config_ContactIgnorePhone |
Boolean | - | Skip phone processing |
Config_ContactPhoneTransform |
Boolean | false | Enable phone formatting |
Config_ContactPhoneTransformE164 |
Boolean | false | Use E164 international format |
Config_ContactPhoneTransformSep |
String | - | Phone number separator |
Address processing#
| Variable | Type | Default | Description |
|---|---|---|---|
Config_ContactIgnoreAddress |
Boolean | - | Skip all address processing |
Config_ContactIgnoreAddressWhenNotEmpty |
Boolean | false | Skip when existing data present |
Config_ContactAddressOverwriteAll |
Boolean | true | Force overwrite existing addresses |
Config_ContactAddressQualityIndex |
Number | - | Minimum quality threshold (0-100) |
Config_ContactAddressQualityWriteNew |
Boolean | false | Write when no existing address |
Config_ContactPostcodeTransform |
Boolean | false | Enable postcode formatting |
Config_ContactUseCountryCode |
Boolean | false | Use country code instead of name |
Config_ContactUseStateCode |
Boolean | false | Use state code instead of name |
Case transformation#
| Variable | Type | Default | Description |
|---|---|---|---|
Config_ContactAddressCityCase |
Number | 0 | City case transformation |
Config_ContactAddressStateCase |
Number | 0 | State case transformation |
Config_ContactAddressStreetCase |
Number | 0 | Street case transformation |
Config_ContactAddressCountryCase |
Number | 0 | Country case transformation |
Config_AdvancedIgnoreMixedCase |
Boolean | false | Ignore mixed-case detection |
Output variables#
| Variable | Type | Description |
|---|---|---|
Record |
Contact SObject | Updated contact record with processed data |
Logs |
MoveDataLogEntry Collection | Processing logs for quality tracking |
LogsJSON |
String | JSON representation of processing logs |
Flow logic#
1. Name processing#
The flow processes contact names with protection and formatting:
- Salutation: Sets contact salutation with configurable case transformation
- First name: Handles first name with length validation (40 chars max)
- Last name: Processes last name with fallback to "[Unknown]" if missing
2. Birthday and phone processing#
- Birthday: Sets birthdate if provided
- Phone formatting: Optional phone number transformation with international formatting
- Phone type classification: Routes phone to appropriate field based on type:
- Mobile: Australian number detection (04, +61 4, +614 patterns)
- Work: Business phone classification
- Home: Residential phone classification
- Default: Falls back to mobile classification
3. Email processing#
Email handling with type-specific routing:
- Work email: Routes to standard Email field and NPSP Work Email
- Home email: Routes to standard Email field and NPSP Home Email
- Default: Uses standard Email field
- NPSP integration: Populates
npe01__WorkEmail__candnpe01__HomeEmail__c
4. Country and state code processing#
The flow includes configurable country and state code handling:
- Country code option: When
Config_ContactUseCountryCodeis enabled andMailingAddress_CountryCodeis provided, uses the country code instead of the country name - State code option: When
Config_ContactUseStateCodeis enabled andMailingAddress_StateCodeis provided, uses the state code instead of the state name - Fallback logic: When codes are not available or configuration is disabled, uses the full country/state names
5. Address quality assessment#
Sophisticated address quality system:
- Quality index scoring: Compares incoming data quality score against threshold
- Existing data detection: Checks for existing address field values
- Force overwrite logic: Configurable forced overwriting of existing addresses
- Quality-based decisions: Skips updates for low-quality data
6. Address field processing#
Dual address support with smart field routing:
Address field selection#
- Mailing address: Primary address fields (MailingStreet, MailingCity, etc.)
- Other address: Secondary address fields (OtherStreet, OtherCity, etc.)
- Field selection: Based on
Use_Mailing_Addressconfiguration
Address validation rules#
Each address component includes:
- Null value handling: Sets fields to NULL when no data provided
- Length trimming: Enforces Salesforce field length limits
- Case transformation: Configurable case formatting
- Quality thresholds: Respects address quality scoring
- Existing data protection: Optional preservation of existing values
Data quality features#
Protection mechanisms#
- Field-level protection: Protect names and other field flags
- Conditional updates: Quality-based update decisions
- Existing data preservation: Configurable protection of existing values
Quality scoring#
- Address quality index: 0-100 scoring system for address data quality
- Threshold enforcement: Configurable minimum quality requirements
- Quality-based routing: Different handling based on data quality scores
Logging and auditing#
- Comprehensive logging: Tracks all processing decisions
- Quality decisions: Logs address quality assessments
- Force overwrite tracking: Logs when data is forcibly overwritten
- Configuration logging: Records configuration values used
Australian phone number support#
Special handling for Australian phone numbers:
- Mobile detection: Recognises 04, +61 4, 4, +614 patterns
- Automatic classification: Routes Australian mobiles to MobilePhone field
- Format preservation: Maintains original formatting when appropriate
Error handling#
- Null value management: Graceful handling of empty/null values
- Length enforcement: Automatic field length compliance
- Quality thresholds: Skips processing for below-threshold data
- Protection respect: Honours all data protection flags
Dependencies#
movedata__SetValueComponent(Apex action)movedata__PhoneNumberFormatterComponent(Apex action)movedata__PostcodeFormatterComponent(Apex action)movedata__WriteToLogFlowComponent(Apex action)movedata__MoveDataLogEntry(Apex class)