Recurring 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_Recurring_Mapping Label: [MoveData] Donation: Recurring - Mapping Type: Auto-Launched Flow Template API version: 60.0 Status: Active
This flow handles the mapping and transformation of recurring donation data from external donation platforms into Salesforce Nonprofit Cloud GiftCommitment records with support for comprehensive donor management and name pattern generation.
Purpose#
The flow processes incoming recurring donation data and maps it to appropriate Salesforce Nonprofit Cloud fields while handling:
- Donor relationship management (Contact/Account assignment)
- Anonymous donor configuration and lookup
- Recurring donation status mapping
- Fee calculation and amount adjustments
- Start date conversions to local timezone
- Campaign associations
- Name pattern generation using configurable templates
- Platform key tracking
Salesforce fields#
This flow interacts with the Nonprofit Cloud GiftCommitment object and its related fields. Below is a comprehensive mapping of all fields utilised:
| Object | Field API name | Field type | Purpose in flow |
|---|---|---|---|
| GiftCommitment | Id | ID | Unique record identifier |
| DonorId | Lookup to Account | Primary donor (Contact or Account) | |
| CampaignId | Lookup to Campaign | Associated campaign for the recurring donation | |
| EffectiveStartDate | Date | Date the recurring donation starts | |
| Status | Picklist | Current status of the recurring donation | |
| ScheduleType | Picklist | Type of schedule (set to "Recurring") | |
| Name | Text | Generated name for the gift commitment | |
| Platform_Key__c | Text | Platform identifier for matching | |
| Account | Id | ID | Contact/Account identifier |
| Name | Text | Contact/Account name | |
| FirstName | Text | Contact first name | |
| LastName | Text | Contact last name |
Input variables#
Core recurring donation data#
| Variable | Type | Required | Description |
|---|---|---|---|
Record |
GiftCommitment | Yes | The GiftCommitment record being processed |
Amount |
Currency | No | Recurring donation amount per instalment |
StartDate |
DateTime | No | Recurring donation start date/time |
Status |
String | No | External platform status (active/cancelled/complete/failed/paused) |
CurrencyType |
String | No | ISO currency code |
Platform integration#
| Variable | Type | Description |
|---|---|---|
PlatformKey |
String | Unique platform identifier for tracking |
Related records#
| Variable | Type | Description |
|---|---|---|
DonorContact |
Account SObject | Associated contact for the recurring donation |
DonorAccount |
Account SObject | Associated account for the recurring donation |
DonationCampaign |
Campaign SObject | Associated campaign |
Fee calculation#
| Variable | Type | Description |
|---|---|---|
FeePlatform |
Currency | Platform processing fee |
FeePlatformPublic |
Currency | Public platform fee |
Donation_FeePlatform |
Currency | Associated donation platform fee |
Donation_FeePlatformPublic |
Currency | Associated donation public fee |
Configuration variables#
| Variable | Type | Default | Description |
|---|---|---|---|
Config_AnonymousContactId |
String | - | ID of anonymous contact for anonymous donations |
Config_DonationAmountSubtractFeePlatform |
Boolean | false | Whether to subtract platform fees from amount |
Config_RecurringSuppressCampaign |
Boolean | false | Skip campaign assignment |
Config_RecurringSuppressStartDate |
Boolean | false | Skip start date setting |
Config_RecurringSuppressName |
Boolean | false | Skip name generation |
Config_RecurringIgnoreStartDateNotEmpty |
Boolean | false | Only set start date if empty |
Config_RecurringNameContact |
String | Default | Name pattern template for contact donors |
Config_RecurringNameAccount |
String | Default | Name pattern template for account donors |
Output variables#
| Variable | Type | Description |
|---|---|---|
Record |
GiftCommitment | Updated gift commitment record |
Errors |
String[] | Error collection |
Logs |
MoveDataLogEntry[] | Processing logs |
LogsJSON |
String | JSON representation of logs |
Flow logic#
1. Donor assignment#
The flow determines the primary donor relationship using this hierarchy:
| Priority | Condition | Action |
|---|---|---|
| 1 | Existing donor relationship present | Preserve existing assignment |
| 2 | Both Contact and Account missing + Anonymous Contact configured | Use anonymous contact |
| 3 | Contact provided (Account missing) | Assign to Contact |
| 4 | Account provided | Assign to Account |
Anonymous contact handling#
For anonymous donations:
- Configuration check: Validates
Config_AnonymousContactIdis provided - Contact lookup: Retrieves anonymous contact record
- Error handling: Sets appropriate errors if configuration missing or contact not found
2. Date processing#
Converts start date from DateTime to local date:
- Component: Uses
ConvertToLocalDateFlowComponent - Assignment: Sets
EffectiveStartDatefield - Configuration: Respects
Config_RecurringSuppressStartDateandConfig_RecurringIgnoreStartDateNotEmpty
3. Status mapping#
Maps external platform statuses to Nonprofit Cloud values:
| External status | Nonprofit Cloud status |
|---|---|
| cancelled | Closed |
| complete | Closed |
| failed | Lapsed |
| paused | Paused |
| (other/success) | Active |
4. Amount calculation#
Calculates the final amount using the formula:
CalculatedAmount = IF(Config_DonationAmountSubtractFeePlatform, Amount - FeePlatform, Amount)
Fee calculation hierarchy:
FeePlatformPublic(if provided)Donation_FeePlatformPublic(if provided)FeePlatform(if provided)Donation_FeePlatform(if provided)- 0 (default)
5. Campaign association#
Campaign assignment logic:
- Skip: If
Config_RecurringSuppressCampaignis true - Assign: If
DonationCampaignis provided and has valid ID - Ignore: Otherwise
6. Name generation#
The flow uses configurable name patterns based on donor type:
Pattern selection#
- Contact donors: Uses
Config_RecurringNameContacttemplate - Account donors: Uses
Config_RecurringNameAccounttemplate - Fallback: Uses ASCII-encoded default patterns if configuration is empty
Name pattern processing#
- Component: Uses
NamePatternParserComponentfor template processing - Variables: Supports Contact, Account, Amount, and date placeholders
- Fallback: Uses calculated name formula if pattern parsing fails
Default name patterns#
- Contact:
{!Contact.Name} - {!Amount} - {!EffectiveStartDate} - Account:
{!Account.Name} - {!Amount} - {!EffectiveStartDate}
7. Record finalisation#
Final processing steps:
- Schedule type: Sets to "Recurring"
- Platform key: Assigns for future record matching
Processing summary#
- Donor evaluation: Determine donor assignment strategy
- Anonymous handling: Process anonymous contact configuration if needed
- Date conversion: Convert start date to local timezone
- Status mapping: Map external status to Nonprofit Cloud values
- Campaign assignment: Associate with campaign if provided
- Name generation: Create record name using patterns or fallback
- Record finalisation: Set schedule type and platform key
Configuration options#
Donor management#
- Anonymous contact:
Config_AnonymousContactIdspecifies fallback contact for anonymous donations
Field processing control#
- Suppress campaign: Skip campaign assignment entirely
- Suppress start date: Skip start date processing
- Suppress name: Skip name generation
- Conditional start date: Only set if field is currently empty
Name pattern configuration#
- Contact template: Configurable pattern for contact-based donors
- Account template: Configurable pattern for account-based donors
- Default fallback: ASCII-encoded patterns used when configuration is empty
Fee processing#
- Platform fee subtraction: Optionally subtract fees from donation amount
- Fee hierarchy: Supports multiple fee sources with priority ordering
Error handling#
Anonymous contact errors#
- Missing configuration: Error when anonymous contact ID not configured
- Contact not found: Error when configured contact cannot be retrieved
Name generation errors#
- Pattern parsing failure: Falls back to calculated name formula
- Error logging: Logs pattern parsing failures for troubleshooting
Data validation#
- Null value handling: Graceful handling of missing donor information
- Existing record preservation: Protects existing donor relationships
Dependencies#
movedata__ConvertToLocalDateFlowComponent(Apex action)movedata__NamePatternParserComponent(Apex action)movedata__WriteToLogFlowComponent(Apex action)movedata__MoveDataLogEntry(Apex class)