Print this page

Can Campaign Influence be imported with the Data Loader?

Knowledge Article Number 000004247
Description
Warning
User-added imageThis workaround is only applicable for organizations that do not have campaign influence automatic association enabled. If it's enabled as outlined in Configuring Campaign Influence the update operation may result in the creation of duplicate Campaign Influence records.


Be sure to thoroughly test, in a sandbox for example, before committing the update against live production data. This process is not reversible and the only means to undo the operation is to manually delete the resulting Campaign Influence records individually via the user interface.


The Campaign Influence object is not available via the API and therefore it is not possible to directly insert new or update existing campaign influence records.

As a potential workaround it is possible to perform an update operation to the Opportunity's Primary Campaign Source (CampaignId) field via the API to indirectly trigger the creation of Campaign Influence records.

The Primary Campaign Source field on the Opportunity is automatically populated via the system when an associated campaign influence record is edited and
 marked as the Primary Campaign Source.

Similarly, populating the Primary Campaign Source field on the Opportunity with a campaign automatically creates a corresponding campaign influence record if one does not exist and inherently sets or updates it as the Primary Campaign Source.

Resolution

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. 
 

Note
Note
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 IdCampaign Id
00630000010Tyr170130000000PKJ1
00630000010Tyo270130000000PKK2
00630000010Tyo270130000000PKL3 
00630000010Tyf370130000000PKM4
00630000010Tyl470130000000PKN5
00630000010Tyl470130000000PKO6
00630000010Tyl470130000000PKP7


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.





promote demote