Here is our proposed solution.
Context : you have a checkbox on the SF Lead object, synced to MC using MC Connect. You also have a List in Email Studio which Subscribers can Opt-in or Out. You want the checkbox to be the mirror of the list subscription.
First, let's evaluate the options :
A and D states are synced, so no action required. In case the user is Unsubscribed and the checkbox is checked, the checkbox state must be inverted (option C). If the checkbox is unchecked and the user is subscribed, he/she must be opted out from List in MC (B).
Then we will have a 2 states process : Detect and Act.
1 - Detect
We will create a DE filled with Subscribers / Leads in the state B or C.
We will use an SQL query for this :
a.SubscriberKey as sKey,
a.Status as MCStatus,
b.sf_checkbox__c as SFStatus
a.SubscriberKey = b._ContactKey
a.ListName = 'My List'
(a.Status = 'active' and b.sf_checkbox__c = 0)
(a.Status = 'unsubscribed' and b.sf_checkbox__c = 1)
The result will be regularly updated using Automation Studio and Overwriting a target DE.
- we are using both Synchronised Lead DE and Data View.
- this can be applied to SF Contacts as well, but keep in mind the creation of another Contact in All Contact in case of a conversion, and map the checkbox in the conversion process from Lead to Contact.
- we are mimicking the Pardot "Do No Email" field, here ;)
- can be adjusted in case of multiple List / Field
This will produce something to act on, like this :
2 - Act
Case C : (SF Field checked and the user is unsubscribed from the List) we will automate this with Journey Builder, having the previous DE as its Entry Source :
We first use a Decision Split to catch only case C contacts, and then apply a Lead Simple Modification to invert the checkbox state.
Case B - is detected in the previous DE and unsubscribing a Contact from a List can be done in AMPScript. It is the case where a Sales unchecks the box on behalf of a user. Maybe you could send an Email in the previous Journey (other branch of the decision split) to acknowledge and have a chance to have the user resubscribe (from Preference Center). This Email would trigger the AMPScript.