Create Campaign Member Statuses Automatically with Salesforce Flow
By Carl Mortimer
May 05, 2022
Salesforce campaign member statuses are hugely important but are often overlooked, or not used properly. The breakdown of which prospects are interacting, and when, will give you insight into how your campaigns are performing.
Pardot (oops, I mean Marketing Cloud Account Engagement) can update Salesforce campaign member status based on a prospect’s engagement with each asset/campaign by using completion actions.
The hurdle commonly faced here, is that the campaign member statuses must exist on the Salesforce campaign, to appear in Pardot. Only those status values will be available to select in automations (e.g. completion actions).
If you’re familiar with campaign member statuses, you will know that campaigns are created with two default statuses “Sent”, “Responded” (and Connected). However, these offer little insight. If someone is listed as responded, how did they respond?
Not all campaigns are the same; you’ll probably want a different set of statuses for a webinar compared to an email campaign. For many marketers, editing campaign member statuses is a manual process, which of course, comes with the risk of human error.
Statuses can be forgotten about or even neglected. Luckily, we can automate how campaign member statuses are created based on the campaign type and by leveraging Salesforce Flow.
Prep Work: Plan Campaign Member Statuses
First off, plan what statuses you want for each campaign type.
This step doesnt need to be complex. Take a spreadsheet or word doc, find the list of the available Campaign Types (picklist field values) and which campaign member statuses you want for each type.
Further tips for planning campaign member statuses can be found here.
In this example, I’ve decided to use the following statuses, in addition to the default statuses:
Webinar – Registered, Attended, No Show
Email – Clicked, Viewed, Unsubscribed
Trade Show – Visited Stand, Appointment Booked
The Salesforce Flow Overview
The Salesforce Flow (pictured below) is relatively simple. The Flow is triggered by a new campaign being created. We then decide what type of campaign we are dealing with and from there, add the campaign member statuses relevant to that campaign.
For this example, I’ll focus on the webinar path (the setup process is the same for the other paths).
We are only concerned with taking this action when a campaign record is created. Follow the screenshot below, and make sure you optimize the Flow for “Actions and Related Records”.
Step 2: Edit the Decision
We now need to decide what type of campaign we have created using a Decision.
Set the Label to Webinar (the API name will auto populate).
Ensure all condition are met (AND).
In the resource field, scroll down to find $Record (Campaign), then select Type → Equals → Webinar.
Click the + button next to Outcome Order on the left, and repeat these steps for the remaining campaign types.
Click Done when you’re finished.
Step 3: Edit the Path
You’ll now see the flow has opened up a number of paths for us to work with.
In the webinar path, click the + button and select Create Records.
Label the Create Record component.
Under “How many records to create”, select One.
Select the option to Use separate recourse and literal values.
Next, select Campaign Member Status as the object.
In the first field, select CampaignID from the campaign. Ensure the value selected is the campaign record and the ID, so we are updating the Campaign record that started this whole process.
HasResponded, select either True or False. In this example, for the status “Registered”, I’ll categorize this as a responded value. Select $GlobalConstant.True
IsDefault, I’ve selected $GlobalConstant.False. This is the same for them all as none of these I want as my default status
Label, which is what you’ll see in your campaign member status list.
Step 4: Repeat for the other Campaign Statuses, by Type
Repeat these steps for the remaining statuses, for the other campaign types you have created paths for (you added these in the Decision, in step 2).
Tip: on the canvas, click the element you have just created and click Copy Element. When you click the + button after this element, you can just paste the copied element and just update the label (and other fields).
Summary
Now that’s complete, every time a campaign is created, you’ll have more meaningful member statuses straight away that you can use in Pardot (sorry, Account Engagement!) for Completion Actions and Automation Rules.
does this still work? my flow doesn't let me do a create records for that, and when i try to deploy a working version from an old sandbox it tells me "createStatuses (Create Records) - The object "CampaignMemberStatus" can't be created through a flow."
hey, did you know what to do with the default status? I've followed the instructions, and the flow works, but the default status is also included in the list.
This seemed to work the first time I created a campaign, but failed the second time because it was creating a picklist value that already existed in the list, Maybe I'm missing something?
What to do when a campaign is being cloned by an end-user? It will run in to an error saying the Campaign member statuses already exist. I cannot figure out how to avoid this. Does anyone know?
I'd like to add one thing. If you're considering to add Sort Order avoid using 1 and 2 as these are assigned to the default campaign member statuses. And if you're considering to delete these default campaign members, consider the order of operations as SF campaign has to have at least one Responded member status. I encountered couple of errors when I was modifying the scope of the flow like this one. :)
Comments: