function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sridhar RamamoorthySridhar Ramamoorthy 

Duplication of contact is created in MailChimp

Hi All,

I'm seeing few duplicates are being added to my MailChimp Account.
My issue is if a contact’s email address is changed in Salesforce this change is not correctly handled in MailChimp. A new MailChimp record is created, instead of updating the existing MailChimp record. This leads to extra MailChimp contacts which can potentially cost us time. Do anybody faced a similar situation like this? Refer the link below for more information,

Link 01 - https://www.screencast.com/t/YCISUKfrmK

Link 02 - https://www.screencast.com/t/KobtjDvpC

Thanks,
Sri
HARSHIL U PARIKHHARSHIL U PARIKH
You need to properly establish the connection between these two system though.

Have a somesort of formula like, when Contact is Updated then go find similar email address contact in mailchimp and then do the operation.
And if similar email address conatct is not found then create an another contact.
Sridhar RamamoorthySridhar Ramamoorthy
Hi Harshil,
Can you elaborate more about that "some sort of formula"? I need to write that formula on Salesforce or in MailChimp?
Thanks
HARSHIL U PARIKHHARSHIL U PARIKH
Formula can go under Salesforce.

Something along the following line:
 
String ContactEmail = Contact.Email;

String PreviousEmail = Trigger.OldMap.get(Contact.Id).Email;

If ContactEmail != PreviousEmail

then see if there is any other contact in database who has this newly entered email address

List<Contact> similarEmailCons = [Select Id, Email FROM Contact WHERE Id != : Trigger.New AND Email =: ContactEmail];

If found then update the the contacts who are in the list 
Otherwise create a new contact