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:
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.
Here is the view of the Record Lookup when it is complete with all three variables added:
Step 2: The Decision
Step 3: The Update to Campaign Member
Step 4: Create Campaign Member
Next, we create a Process Builder to execute the Flow.
The Overview of the Process Builder
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
Because we have two stages we need to have customized logic (1 or 2) and 3 and 4:
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:”
- CampaignID is referencing Opportunity: CampaignID
- 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:
Juan Garcia had a great time at the event! He donated $5000.00 to the Super Fun Event:
After the opportunity is saved, his campaign member status has changed:
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.
Update: Thanks to a team at the Seattle NPSP Sprint in October 2015, this functionality is now included in Nonprofit Starter Pack v3.