Campaign post-upsert 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_Post Label: [MoveData] Donation: Campaign - Post Upsert Type: Auto-Launched Flow Template API version: 60.0 Status: Active
This flow handles post-processing operations after campaign records are created or updated, including campaign member structure initialisation, GAU (General Accounting Unit) copying from parent campaigns, and campaign member creation.
Purpose#
The flow performs post-upsert operations that:
- Initialise campaign member status structures with configurable labels
- Copy GAU allocations from parent campaigns to child campaigns
- Create campaign member records for primary contacts
- Establish hierarchical campaign member value structures
Salesforce fields#
This flow interacts with the Salesforce Campaign 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 |
| Name | Text (80) | Campaign name identifier |
Input variables#
Core campaign data#
| Variable | Type | Required | Description |
|---|---|---|---|
Record |
Campaign SObject | Yes | The Campaign record being processed |
ParentCampaign |
Campaign SObject | No | Parent campaign for inheritance operations |
CampaignContact |
Contact SObject | No | Primary contact to be added as campaign member |
Type |
String | No | Campaign type ('team' or other) affecting member status |
IsNewRecord |
Boolean | Yes | Indicates if this is a new campaign creation |
HasParentCampaign |
Boolean | Yes | Flag indicating parent campaign presence |
Campaign member configuration#
| Variable | Type | Default | Description |
|---|---|---|---|
Config_CreateCampaignMembers |
Boolean | true | Enable campaign member creation |
Config_CampaignMemberDeleteExistingStatuses |
Boolean | false | Remove existing member statuses |
Config_CampaignMemberLabelTeamLeader |
String | "Team Leader" | Label for team leader status |
Config_CampaignMemberLabelFundraiser |
String | "Fundraiser" | Label for fundraiser status |
Config_CampaignMemberLabelRecurringDonor |
String | "Recurring Donor" | Label for recurring donor status |
Config_CampaignMemberLabelDonor |
String | "Donor" | Label for donor status |
Config_CampaignMemberLabelProspect |
String | "Prospect" | Label for prospect status |
Processing variables#
| Variable | Type | Description |
|---|---|---|
CampaignIdList |
String Collection | List of campaign IDs for the current and previous campaign phases |
Flow logic#
1. Campaign member structure initialisation#
The flow first determines if MoveData campaign member structure should be used:
- If
Config_CreateCampaignMembersis true: Initialises campaign member statuses - If disabled: Skips member structure setup
2. Campaign member status setup#
When enabled, the flow calls InitialiseCampaignMemberComponent with:
- Configurable status labels for different member types
- Optional deletion of existing campaign member statuses
- Campaign-specific member status initialisation
3. GAU inheritance processing#
For new records with parent campaigns:
- Condition:
IsNewRecord = trueANDHasParentCampaign = true - Action: Copies GAU allocations from parent to child campaign
- Component:
CopyGauBetweenCampaignsFlowComponent
4. Campaign member creation#
When a primary contact is provided:
- Condition:
CampaignContactexists ANDConfig_CreateCampaignMembers = true - Process: Creates campaign member record with appropriate status
- Status logic: Uses formula to determine member status based on campaign type
5. Member value hierarchy setup#
The flow establishes a hierarchical order of campaign member statuses:
- Team Leader
- Fundraiser
- Recurring Donor
- Donor
- Prospect
A contact associated with the campaign will receive only one of these statuses.
Dependencies#
InitialiseCampaignMemberComponent(Apex action)CopyGauBetweenCampaignsFlowComponent(Apex action)CreateCampaignMemberComponentWithLogs(Apex action)