With this information it is possible to indirectly create new and/or update existing Campaign Influence records through updating the Primary Campaign Source (CampaignId) field on the Opportunity.
Create a .csv file with two columns titled, "Opportunity Id" and "CampaignId":
- Opportunity Id column contains the Opportunity Ids for which you're creating campaign influence records.
- CampaignId column contains the Campaign Ids that you're associating to the Opportunity via a campaign influence record.
If adding multiple campaigns to an opportunity create an individual row for each unique Opportunity Id and CampaignId combination in your import file. The CampaignId for the last occurrence of an Opportunity Id will be set as the primary campaign source because it is the campaign ultimately saved into the Primary Campaign Source (CampaignId) field when the update operation is complete.
When complete your file should look similar to this example:
|Opportunity Id||Campaign Id|
To illustrate: 2 unique campaign influence records will be created for the Opportunity with Id: 00630000010Tyo2. The first for the 00630000010Tyo2 / 70130000000PKK2 combination and the second for 00630000010Tyo2 / 70130000000PKL3. Since 70130000000PKL3 is the last CampaignId specified for that particular Opportunity Id, it will be the record that's ultimately set into the Opportunity's Primary Campaign Source lookup field and therefore be marked as the Primary Campaign Source via the checkbox in the Campaign Influence related list. Similarly, 3 unique campaign influence records will be created for the Opportunity Id: 00630000010Tyl4 with the Campaign Id: 70130000000PKP7 being set as the Primary Campaign Source.
When utilizing the workaround note the following behaviors:
- If the CampaignId specified in the file is already associated to the opportunity via a campaign influence record a duplicate is not created.
- If the CampaignId specified in the file is already associated to the opportunity and is the last row in the file for a particular Opportunity Id any matching campaign influence records will be updated to be the primary.
- If the CampaignId in the file is not already associated to the opportunity specified a campaign influence record is created.
- If the CampaignId in the file is not already associated to the opportunity specified and is the last row in the file for a particular Opportunity Id a campaign influence record is created and set as the primary.
The API is available by default in Enterprise Edition or higher. If your organization is on Professional Edition you will need to either reach out to your Account Executive to discuss provisioning a courtesy contract to temporarily provision the API or consider the user of a 3rd party tool such as (Data Loader IO, Jitterbit, etc.).
If you're enabled for checkout you can locate your Account Executive's contact details in the Checkout Summary page which is available while logged into Salesforce by clicking here or alternatively you can dial 1-800-NO-SOFTWARE.