Campaign name 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_Name Label: [MoveData] Donation: Campaign - Name Type: Auto-Launched Flow Template API version: 60.0 Status: Active
This utility flow generates hierarchical campaign names by combining campaign names with parent campaign references, supporting multi-tier naming conventions for complex campaign structures.
Purpose#
The flow creates structured campaign names that:
- Generate hierarchical naming conventions based on campaign relationships
- Support multi-tier campaign structures with parent-child relationships
- Respect name protection settings to prevent unwanted overwrites
- Use campaign codes or names from parent campaigns for consistency
- Provide different naming formats based on campaign hierarchy depth
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 |
|---|---|---|
| Name | Text (80) | Campaign name identifier |
| movedata__Campaign_Code__c | Text | Short code identifier for campaign naming |
| movedata__Protect_Name__c | Checkbox | Prevents automatic updates to campaign name |
Input variables#
| Variable | Type | Required | Description |
|---|---|---|---|
Record |
Campaign SObject | Yes | The Campaign record being processed |
Name |
String | Yes | Base campaign name from external platform |
ParentCampaign |
Campaign SObject | No | Parent campaign for hierarchical naming |
CampaignIndex |
Number | Yes | Hierarchy level indicator (1, 2, or higher) |
Config_CampaignNameIgnoreCampaignCode |
Boolean | No | Whether to ignore campaign codes (default: false) |
Output variables#
| Variable | Type | Description |
|---|---|---|
Result |
String | Generated campaign name with appropriate hierarchy formatting |
Record |
Campaign SObject | Updated campaign record |
ParentCampaign |
Campaign SObject | Parent campaign reference |
Flow logic#
1. Name protection check#
The flow first determines if the existing name should be preserved:
- If
movedata__Protect_Name__cis true: Returns existing record name unchanged - If name is not protected: Proceeds to generate hierarchical name
2. Campaign index evaluation#
The flow uses the CampaignIndex to determine naming strategy:
Index = 1 (single tier)#
- Returns the provided
Namedirectly - No parent hierarchy formatting applied
Index = 2 (two tier)#
- Combines parent campaign name with current name
- Uses colon separator format:
Parent: Child
Index > 2 (multi-tier)#
- Uses hyphen separator format:
Parent - Child - Supports deep hierarchical structures
3. Parent name determination#
For hierarchical naming, the flow determines parent name source:
Priority order:#
- Campaign code: Uses
movedata__Campaign_Code__cif available and not ignored - Campaign name: Falls back to parent
Namefield
4. Name format generation#
The flow applies different formatting based on hierarchy level:
Single-tier format#
ChildName
Example: Annual Gala
Two-tier format#
ParentName: ChildName
Example: Annual Gala: Online Donations
Multi-tier format#
ParentName - ChildName
Example: Annual Gala: Online Donations - Jack's Fundraiser
Configuration options#
Config_CampaignNameIgnoreCampaignCode#
- Default:
false - Purpose: When
true, ignores campaign codes and uses campaign names instead - Impact: Affects parent name selection for hierarchical formatting
Naming examples#
Single campaign (Index = 1)#
- Input:
Name = "Emergency Relief" - Output:
"Emergency Relief"
Two-tier campaign (Index = 2)#
- Parent: Campaign with Code "GALA2024"
- Input:
Name = "Online Auction" - Output:
"GALA2024: Online Auction"
Multi-tier campaign (Index > 2)#
- Parent:
Name = "Annual Gala: Online Donations" - Input:
Name = "Jack's Fundraiser" - Output:
"Annual Gala: Online Donations - Jack's Fundraiser"
Dependencies#
None