Synchronizing Zoho CRM Contacts with MailChimp Subscribers

In this tutorial we will show how to create a synchronization package that synchronizes Zoho CRM contacts with MailChimp subscribers.

In this tutorial we suppose that there are no corresponding records present both in Zoho CRM and MailChimp already. This is because when a Synchronization package is performed the first time, it copies all the source data to target and all the target data to source without any check if the corresponding records are already present in the opposite source. If some of the records were present in both sources, Skyvia will create duplicate data. That's why it's better to perform the first synchronization when one of the sources is empty or at least does not contain records, present in the other source. When performing next synchronizations, Skyvia already knows how the records in the source and target correspond to each other and loads only the changed data between sources.

 

ExpandedToggleIcon        Creating Connections

In order to synchronize Zoho CRM contacts with MailChimp subscribers, first we need to create connections to Zoho CRM and MailChimp. If you have already created the necessary connections, you may skip these steps. To create a connection to Zoho CRM, perform the following steps:

1.Open the Connections page by clicking Connections in the menu on the left side of the page.
2.Click the New button.
3.In the opened pane click Zoho CRM.
4.In the opened New Connection dialog box, specify a connection Name that will be used to identify the connection.
5.Click Log In with Zoho.
6.In the opened window enter your Zoho CRM credentials and click the Sign In button.
 
zoho-login
7.After that, copy the text in the second line after 'AUTHTOKEN='.
 
zoho-token
8.Paste the copied text to the Access Token box.
 
zoho-connection-editor-with-token
9.In the Time Zone box select the timezone that is specified in your Zoho CRM account settings. This is an important step, because when Time Zone is set incorrectly, it may lead to incorrect date and time data processing, incorrect work of lookup mapping, incorrect change detection when performing replication or synchronization, etc.
10. Optionally change the Metadata Cache parameter value. It determines how often to update cached metadata for the connection. By default, Skyvia caches metadata of available objects for cloud sources. You can configure how often the cache is refreshed automatically or reset in manually on the Connection Details page of the corresponding connection by clicking the Clear link in the Metadata cache parameter in the Parameters pane.
11. Click the Save button to save the connection.

To create a connection to MailChimp, perform the following steps:

1.Open the Connections page by clicking Connections in the menu on the left side of the page.
2.Click the New button.
3.In the opened pane click MailChimp.
4.In the opened New Connection dialog box, specify a connection Name that will be used to identify the connection.
 
mailchimp-connection-editor
5.Click Log In with MailChimp.
6.In the opened window enter your MailChimp credentials and click the Log In button.
 
mailchimp-connection-login
7.Optionally select values for the Merge Fields Behavior and Metadata Cache parameters.
8.Save the connection.

 

ExpandedToggleIcon        Creating Package

When loading subscribers to MailChimp, you need to specify the MailChimp list to load subscribers to by mapping the ListId field of the MailChimp ListMembers table. You can either find out the id of the list (with an export package or with Query or directly via MailChimp interface) and specify it via the Constant Mapping or use the Lookup Mapping to get the list Id, for example, by its name, like we will do in this tutorial. We will synchronize Zoho CRM contacts with a list, having the name 'Sync Test List' in this tutorial.

1.Click Integration on the menu on the left side of the page.
2.Click the New button in the top right corner of the page.
3.Click Synchronization.
4.Optionally click the automatically generated package name (on this step it's "Sync Package") and specify the package name.
5.Click Select in the Source header and select Zoho CRM in the drop-down list.
6.In the Source Connection drop-down list select the Zoho1 connection.
 
select-source-zoho-connection
7.Click Select in the Target header and select MailChimp in the drop-down list.
 
target-type-selection-sync
8.In the Target Connection drop-down list select the MailChimp1 connection.
9.Click the + Add task button.
10. In the drop-down list under Source select Contacts.
11. In the drop-down list under Target select ListMembers.
 
sync-mailchimp-zoho-tables
12. Click Next.
13. Now we need to map target fields to source fields. As we can see, some of the columns that have the same names in MailChimp ListMembers table and Zoho CRM Contacts table, are already mapped automatically. We need to map only the ListId column. It is marked as Required, which means, it must be mapped in order for the package to be valid. If you know the Id of the necessary list, you can use Constant Mapping and specify this Id as a constant (See MailChimp documentation on how to find the list ID). We will use lookup by constant to get the Id value of the List with the name 'Sync Test List'. To configure such a mapping, perform the following steps:
a.Click ListId in the list of target fields.
b.Click Column and then select Lookup in the drop-down list.
c.In the Lookup Object drop-down list select an object to get the value from (in our example, Lists. It is selected automatically).
d.In the Result Column drop-down list select a column from the Lookup Object to get the result value that will be assigned to the mapped target column (in our example, Id is selected as a result column. It is selected automatically).
e.In the Lookup Key Column drop-down list select the target lookup key column (in our example, Name).
f.In the Column drop-down list select Constant.
 
lookup-mapping-kinds-small-sync
g.Enter the corresponding list name - "Sync Test List" - to the box. (String constants are entered without quotes).
h.Select the Use this value as filter of target records check box. This means that when synchronizing data in the reverse direction (from MailChimp to Zoho CRM) only records with the corresponding ListId value are synchronized, subscribers from other lists are ignored.
 
sync-mailchimp-zoho-lookup
14. Now let's configure mapping in the opposite direction. In synchronization tasks you need to specify mapping for both directions - from source to target and from target to source. Click Target to Source under task editor header.
15. Here, the First Name, Last Name, and Email Zoho CRM fields are already mapped. Let's also map the Email Opt Out field so that when MailChimp subscriber unsubscribes, it will be automatically set. We will use the Expression Mapping for this.
a.Click Email Opt Out in the list of the source fields.
b.Click Column and then select Expression in the drop-down list.
c.Enter the following expression to the box below:
 
Status == "Unsubscribed" ?  true : false
 
This expression checks the status of the subscriber in MailChimp, and if the status is "Unsubscribed", it returns the true boolean value, which is assigned to the Email Opt Out field in MailChimp. Otherwise, false is assigned.
16. Click Finish.

 

ExpandedToggleIcon        Scheduling Package Execution

After we have created the synchronization package, we want to keep the data in sync automatically. For this, we will configure the package to run every hour during workdays.

Note that since we used Zoho CRM connection as the source, its changes have a priority, and if a record was changed both in Zoho CRM and MailChimp database, Zoho CRM changes are applied.

Perform the following actions to set the schedule:

1.Under Schedule (at bottom left of the package editor) click the Set schedule button.
 
schedule-empty
2.In the Run every drop-down list select Week.
3.Click all the workdays in Days of week.
 
schedule-week-days
4.Click Occurs once at and select Recur every.
 
schedule-recur-every
5.Enter "1" (without quotes) into the Recur every box and click the Set time restrictions link.
 
schedule-every-hour
6.Set Start at to 8:00 and End at to 17:59.
 
schedule-time-restrictions
7.Save the package.

After this our package will run automatically every hour between 8:00 and 17:59 of every workday.

You can also visit Scheduling Packages to get more detailed information on setting a package schedule.