Suppose we need to import subscribers from a mailing list in Mailchimp to Salesforce contacts, and part of the corresponding contacts are already present in Salesforce. We don't want to make duplicate records, so we perform UPSERT instead of usual INSERT. So, to perform such an import, let's do the following:
Creating a Package
|1.||Click Integration in the menu on the left side of the page.|
|2.||Click the New button in the top right corner of the page.|
|4.||Click CSV in the Source header and select Mailchimp from the list. |
|5.||Click Select in the Target header and select Salesforce from the list. You can use the Search box to quickly find the necessary source. |
|6.||Select corresponding connections in the Source Connection and Target Connection lists. In order to shorten this example, let's assume, we already have the connections created. If not, see the Connecting to Salesforce and Connecting to Mailchimp topics.|
When configuring the source data, we need not only to select the source table, but also to configure data filtering in order to import subscribers only from one of the lists. In our example, the name of this list is "Test list".
|1.||In the Object list select ListMembers. |
|3.||In the first (leftmost) list of the condition, select Lists. |
|4.||In the second list of the condition, select Name. |
|5.||Enter "Test list" to the rightmost box of the condition. |
|1.||In the Target list, select Contact. |
First we need to map the Id column of Salesforce Contact. As we can see, it is automatically mapped to the Id column of the Mailchimp ListMembers table, because these columns have the same name. However, Salesforce and Mailchimp Ids have different format and are completely different things, so we cannot map Salesforce Ids to Mailchimp Ids. We will use the lookup mapping to map the target Id field, and determine the necessary Contact Ids by email.
|2.||Click Column and then select Target Lookup on the list.|
|3.||In the Lookup Object list, select Contact.|
|4.||In the Result Column list, select Id.|
|5.||In the Lookup Key Column list, select the Email target column. |
|6.||In the bottom drop-down list, select the Email source column. |
|8.||Select the Set null when no match found check box|
|9.||Click the LastName column and map it to the Last Name source column using column mapping. |
|10.|| In the same way map the FirstName target column to the First Name source column.|
Now our package is ready, and you can execute it.