+ Start a Discussion
Glenn Nyhan 91Glenn Nyhan 91 

Automatically Moving New Staff Contacts to a Campaign

When a new Staff Member contact is created I would like to create an automated process to add it as a campaign member for our bi-weekly newsletter list. I was wondering if this were possible to do with ProcessBuilder. I have found a few references claiming it can, but have not actually seen any descriptions of the complete process involved. Has anyone done this and if so how?

Thanks in advance for any help.

Glenn
Andrew GAndrew G
Assuming you have some way to indicate that a contact is a staff member - process below assumes a custom checkbox "IsStaff__c"

New Process Builder
Name – add staff to bi-weekly newsletter
The process starts with – A record change
Click Save.
Add Object
Object – Contact
 “only when a record is created”  - setting to ‘when created or edited’ will give error due to campaign member needing to be unique.
Add criteria
Criteria name – “is staff”
Check ‘Conditions are met’
Field – [Contact].IsStaff__c Equal Boolean True
Check ‘All conditions are met’
Add Action
‘Create a record’
Name – Create Campaign Membership
Record Type – Campaign Member
Field – Campaign Id – Type ID – Value - <your ID for your bweekly campaign> something like 7012v0000020KDUAA2
 
Contact ID – field reference – [Contact].Id
Status – Picklist – “planned” (or whichever pcklist value you want/need)
Click Save
Click Activate – click confirm

Test away
 
 
Regards
Andrew
 
Glenn Nyhan 91Glenn Nyhan 91
Hi Andrew, Thanks for your reply. I tried this out and got the following error message. Any idea how to solve this? Not sure if it makes a difference but I did not add this: Status – Picklist – “planned” (or whichever pcklist value you want/need) Error element myRule_1_A1 (FlowRecordCreate). This error occurred when the flow tried to create records: DUPLICATE_VALUE: Already a campaign member.. You can look up ExceptionCode values in the SOAP API Developer Guide .
Andrew GAndrew G
Hi Glenn
No, that picklist value won't cause the issue.  The error is because the Campaign Member already exist.  The above process builder assumes that new employees never existed as a member in that particular campaign before, hence why the criteria "only when a record is created".

If you checked and the contact is not already a member of the Campaign, check that you don't have recursion running on the Process builder.

If there is a chance that the employee will exist in the Campaign before they become a contact in the system ., then you may want to investigate Flows. You can set a flow to identify duplicates and stop the record from being created.  You would launch the flow from teh process once you have determined that the Contact meets the criteria (e.g. Isnew() and IsStaff)


Regards
Andrew
Glenn Nyhan 91Glenn Nyhan 91
Hi Andrew,

I got this working. What happened was I created the Process Builder process and that worked but it started steering all contacts to the campaign. I had to further refine the filtering and now it's working fine. Thanks for the help. Also, have you come across and Flows that would prevent dupes. I've been looking around the web but haven't seen any info on this. We wouldn't get dupes in the Staff campaign since those are records added once, but we will if we use this approach elsewhere. 

Best,

Glenn
Andrew GAndrew G
This post should be able to point you in the right direction.
https://biggerboatconsulting.com/how-to-updating-campaign-member-status-via-process-builder-and-flow/

Basically, invoke the flow from process builder, with flow search via Contact and Campaign Id amongst campaign members, if not found create a campaign member

Regards
Andrew