Categories
Administrator Blog

How to: updating Campaign Member status via Process Builder and Flow

Note: this post assumes a basic working knowledge of Salesforce Flows and Process Builder. If you want to learn more about these, we recommend the Trailhead module on Flows and the Trailhead module on Process Builder.

Have you ever wanted to know which of your invited guests to an event actually donated and which ones did not? Ideally, you could look at the Campaign Member Status to find out who was invited and who donated. You can update the Campaign Member Status manually but who has time for that? Instead, you can use Process Builder and Flow to automate this process. Next time a donation is entered along with a Primary Campaign, the donor’s status will automatically change to “Donated” for that Campaign. And, if the donor isn’t a Campaign Member already, the donor will be added to the Campaign with the status of “Donated.”

With Process Builder and Flow, this can now be done declaratively in a few relatively easy steps. First we build a Flow that creates or updates the Campaign Member status to “Donated.” Then we create a Process Builder that calls the flow when a donation/Opportunity is Won.

Create a Flow

Here’s the overview of the Flow:

Flow overview

 

The details of each of these elements is shown below.

Step 1: Record Lookup

In the Record Lookup, you will add Variables for CampaignID, ContactID. and CampaignMemberID. Here you will see adding the CampaignID.

Flow step 1

Flow Step 1 image 2

Here is the view of the Record Lookup when it is complete with all three variables added:

Flow step 1 image 3

Step 2: The Decision

Flow step 2 image 1

 

 

Flow step 2 image 2

 

Step 3: The Update to Campaign Member

Flow step 3 image 1

 

Step 4: Create Campaign Member

Flow step 4 image 1

Next, we create a Process Builder to execute the Flow.

The Overview of the Process Builder

process builder overview

It is fired when the Donation (Opportunity) is created or edited.

Step 1:  The criteria:

  • Two stages “Won-Not Thanked” and “Closed Won”
  • Campaign ID can not be null
  • Primary Contact can not be null

PB step 1

Because we have two stages we need to have customized logic (1 or 2) and 3 and 4:

PB step 1 image 2

 

Step 2: Now the Action –  Launch the Flow

In this step we are passing to the Flow the CampaignId, ContactID and the Status of “Donated:”

PB step 2 image 1

  1. CampaignID is referencing Opportunity: CampaignID
  2. ContactID is referencing Opportunity:npsp__Primary_Contact__c

The result: what happens in Salesforce

Before any donation is entered, the campaign members look like this:

Image_13

 

Juan Garcia had a great time at the event!  He donated $5000.00 to the Super Fun Event:

Image_14

 

After the opportunity is saved, his campaign member status has changed:

Image_15

That’s it.  Now when an opportunity is created or edited to meet the criteria, a campaign member is either updated or added for the contact.

Good luck!

Update: Thanks to a team at the Seattle NPSP Sprint in October 2015, this functionality is now included in Nonprofit Starter Pack v3.