The campaign member object in Salesforce represents the association between a campaign and a lead or a contact. While some standard lead and contact fields are available for the campaign member object, if you want to view or pull a report for custom fields, you will need to create a new field. This post will show you how to create a formula field on the campaign member object that will pull in the custom field value for a lead or a contact.
Create a formula field
Create a formula field on the campaign member object that will check if the campaign member is a Lead or a Contact and populate the field with the custom field value.
Navigate to the campaign member object within the object manager and create a new formula field.
If your lead and contact fields are picklists, use this syntax for the formula.
IF(ISBLANK(ContactId), TEXT(Lead.Status), TEXT(Contact.Status__c))
If your lead and contact fields are not picklists, use this syntax for the formula.
IF(ISBLANK(ContactId), Lead.Status, Contact.Status__c)
Add the field to campaign member related list
You can add the new custom field to the campaign member related list by navigating to the campaign object in the campaign manager and selecting your page layout. Scroll to the campaign member related list and click on the wrench icon to select your fields.
Now the custom field displays in the related list for campaign members.
Use the fields within reports
The custom field is also available within the campaigns with campaign members report.