Campaign Mapping 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_Campaign_Mapping
- Label: [MoveData] General: Campaign - Mapping
- Type: Auto-Launched Flow Template
- API Version: 49.0
- Status: Active
This flow handles the mapping and transformation of campaign data from external platforms into Salesforce Campaign records, with support for Non-Profit Cloud integration.
Purpose
The flow processes incoming campaign data and maps it to appropriate Salesforce Campaign fields while handling:
- Campaign naming and protection rules
- Status mapping based on external platform states
- Date conversions to local timezone
- Parent-child campaign relationships
- Platform-specific field mappings
- Non-Profit Cloud integration fields
Salesforce Fields
This flow interacts with the Salesforce Campaign object and its related fields. Below is a comprehensive mapping of all fields utilized:
| Field API Name | Field Type | Purpose in Flow |
|---|---|---|
| Id | ID | Unique record identifier |
| Name | Text (80) | Campaign name identifier |
| IsActive | Checkbox | Indicates if campaign is currently active |
| Status | Picklist | Current status of the campaign |
| Type | Picklist | Categorizes the type of campaign |
| ParentId | Lookup to Campaign | Links to parent campaign |
| ExpectedRevenue | Currency | Target fundraising amount |
| StartDate | Date | Campaign start date |
| EndDate | Date | Campaign end date |
| Description | Long Text Area | Detailed campaign description |
| movedata__Platform__c | Text | External platform identifier |
| movedata__Platform_Key__c | Text | Stores unique external platform identifier |
| movedata__Protect_Name__c | Checkbox | Prevents automatic updates to campaign name |
| movedata__Protect_Campaign_Parent__c | Checkbox | Prevents automatic updates to parent relationship |
| md_npc_pack__Campaign_URL__c | URL | Stores web address for online campaign pages |
| md_npc_pack__Fundraising_Account__c | Lookup to Account | Associates campaigns with organizational fundraisers |
Input Variables
Core Campaign Data
| Variable | Type | Required | Description |
|---|---|---|---|
Record |
Campaign SObject | Yes | The Campaign record being processed |
CampaignName |
String | No | Name of the campaign from external platform |
Name |
String | No | Alternative name field |
Description |
String | No | Campaign description |
Status |
String | No | External platform status (draft/live/archive/completed) |
TargetAmount |
Currency | No | Campaign fundraising goal |
StartDate |
DateTime | No | Campaign start date/time |
EndDate |
DateTime | No | Campaign end date/time |
CreatedAt |
DateTime | No | Original creation timestamp |
ModifiedAt |
DateTime | No | Last modification timestamp |
PageUrl |
String | No | Campaign page URL |
Platform Integration
| Variable | Type | Default | Description |
|---|---|---|---|
Platform |
String | - | Platform identifier |
PlatformKey |
String | - | Unique platform key |
PlatformLabel |
String | - | Display label for platform |
Related Records
| Variable | Type | Description |
|---|---|---|
ParentCampaign |
Campaign SObject | Parent campaign for hierarchical structures |
CampaignContact |
Contact SObject | Associated contact for Non-Profit Cloud integration |
CampaignAccount |
Account SObject | Associated account for Non-Profit Cloud integration |
HasCampaignContact |
Boolean | Flag indicating contact association |
HasCampaignAccount |
Boolean | Flag indicating account association |
Configuration Variables
| Variable | Type | Default | Description |
|---|---|---|---|
Config_CampaignDefaultType |
String | "Other" | Default campaign type |
Config_CampaignIgnoreStartDate |
Boolean | false | Skip start date processing |
Config_CampaignIgnoreEndDate |
Boolean | false | Skip end date processing |
Config_CampaignIgnoreName |
Boolean | false | Skip name processing |
Config_CampaignIgnoreDefaultStatus |
Boolean | - | Skip default status logic |
Config_CampaignIgnoreDefaultType |
Boolean | - | Skip default type logic |
Output Variables
| Variable | Type | Description |
|---|---|---|
Record |
Campaign SObject | Updated campaign record with processed data |
Flow Logic
1. Name Processing
The flow first determines if the campaign name should be updated:
- Checks if name protection is enabled (
movedata__Protect_Name__c) - Handles name trimming (limits to 80 characters with "..." suffix)
- Uses configuration flags to skip name processing if needed
2. Campaign Type Assignment
Campaign type is set based on hierarchy:
- Ignore: If
Config_CampaignIgnoreDefaultTypeis true - Inherit: Use parent campaign's type if available
- Default: Use
Config_CampaignDefaultType(typically "Other")
3. Parent Campaign Relationship
- Checks for parent campaign protection (
movedata__Protect_Campaign_Parent__c) - Sets
ParentIdif parent campaign is provided and not protected
4. Status Mapping
External platform statuses are mapped to Salesforce campaign statuses:
| External Status | Salesforce Status | IsActive |
|---|---|---|
| draft | Planned | false |
| live | In Progress | true |
| archive | Completed | false |
| completed | Completed | false |
| aborted | (preserved) | - |
Special handling:
- Respects existing "Aborted" status
- Can be bypassed with
Config_CampaignIgnoreDefaultStatus
5. Amount and Date Processing
- Target Amount: Maps to
ExpectedRevenuefield - Start Date: Converts to local date using
movedata__ConvertToLocalDateFlowComponent - End Date: Converts to local date with configuration-based control
Date Formula Logic:
StartDate = StartDate || EndDate || NotificationDate (where CreatedAt || ModifiedAt)
6. Non-Profit Cloud Integration
When Non-Profit Cloud fields are available:
- Sets
md_npc_pack__Campaign_URL__cfromPageUrl - Sets
md_npc_pack__Fundraising_Account__cfrom associated account (whenHasCampaignAccountis true) - Uses contact association logic for fundraising contact assignment
7. Platform Tracking
- Sets
movedata__Platform__cfield with platform identifier or label - Sets
movedata__Platform_Key__cfor external system tracking
Processing Flow
- Name Protection Check: Verify if name updates should be processed
- Name Assignment: Set campaign name with trimming and validation
- Type Assignment: Apply type hierarchy (inherit from parent or use default)
- Parent Relationship: Set parent campaign if not protected
- Status Mapping: Map external status to Salesforce values
- Amount Processing: Set target revenue if provided
- Date Processing: Convert and set start/end dates with timezone handling
- Description Assignment: Set campaign description if provided
- Non-Profit Cloud Integration: Set URL and fundraising associations
- Platform Tracking: Set platform identifiers for external system tracking
Configuration Options
Name Control
- Ignore Names:
Config_CampaignIgnoreName = trueskips all name processing - Protection Field:
movedata__Protect_Name__cprevents individual record updates
Date Control
- Start Date:
Config_CampaignIgnoreStartDate = trueskips start date processing - End Date:
Config_CampaignIgnoreEndDate = trueskips end date processing
Type and Status Control
- Default Type:
Config_CampaignIgnoreDefaultType = trueskips type assignment - Default Status:
Config_CampaignIgnoreDefaultStatus = trueskips status mapping
Error Handling
Protection Mechanisms
The flow includes several protection fields to prevent overwriting existing data:
movedata__Protect_Name__c: Prevents name updatesmovedata__Protect_Campaign_Parent__c: Prevents parent relationship changes
Data Validation
- Uses conditional logic to handle null values gracefully
- Includes default connectors for decision elements
- Validates required relationships before setting
- Implements fallback logic for date assignment
Dependencies
movedata__ConvertToLocalDateFlowComponent(Apex action)movedata__SetValueComponent(Apex action)