The data synchronization is achieved by constantly running a variable number - depending on the options enabled - of steps. These steps perform different duties and they all concur to keep the data between Salesforce and SalesWings consistent.

Table of content:

Overview of Data Flow

SalesWings -> Salesforce

  • During the synchronization step GetTags a request to SalesWings is performed. All the existing tag definitions are returned and corresponding records in Salesforce are created/updated/deleted

  • During the synchronization step GetScores a request to SalesWings is performed where all the existing score definitions are returned and corresponding records in Salesforce are created/updated/deleted.

  • During the synchronization step GetProspects a request to SalesWings is performed. All the modified prospects since the last synchronization are returned (or all the existing prospects if a full synchronization was requested) and corresponding records in Salesforce are created/updated.

Salesforce -> SalesWings

  • When a contact or lead matched with a prospect is updated and the value for any of the following field changes - Email, SW Favorite, First Name, Last Name, Owner Id, Prospect Id - an update containing the following information - Id, Email, SW Favorite, Name, First Name, Last Name, Owner Email, Prospect Id - is sent to SalesWings. This is done to keep the information presented in the SalesWings cockpit aligned with Salesforce’s.

This document will now describe the workflow steps responsible for keeping data consistent between Salesforce and SalesWings. Follows a description of the duties performed by each step.

Active Steps

Name

Scope

Since

GetTags

  • it upserts as saleswings__SW_Tag__c all tags from SalesWings

2.62

GetScores

  • it upserts as saleswings__Score__c all scores from SalesWings

2.62

GetProspects

  • it upserts as saleswings__Prospect__c all prospects marked as changed by SalesWings since the last synchronization. Each prospect record with life cycle set to Active will have their sync status set to Not Processsed - otherwise Processed - and the Processed Attempts value set to 0.

  • it aligns (creates new, updates existing, deletes orphans) all the tags associated with the prospect being synced to the respective saleswings__SW_Prospect_Tag__c records

  • it aligns (creates new, updates existing, deletes orphans) all the scores associated with the prospect being synced to the respective saleswings__Prospect_Score__c records

2.62

GetProspectPages

  • it aligns (creates new, updates existing, deletes orphans) all the pages associated with the prospect being synced in the previous step with the respective saleswings__Page_Prospect__c records

Note: Since the data volume for pages is significantly higher a dedicated step in the sync is required.

Note: This step is optional and included in the synchronization only if explicitly enabled (see Disable Page Visit Sync in the SalesWings Studio: Custom Settings).

2.119

MatchProspectsToLeads

  • it processes all the prospects set to Not Processed in the GetProspects step. The matching is based on the email address. If there are any leads whose email address corresponds to the prospect’s, the lead gets selected for matching.

  • For each matching lead, the step proceeds to create/align/delete a copy of each prospect’s score, tag, and page (if Disable Page Visit Sync is disabled). See The Data Models subheading for further information.

  • If Match Leads via Platform Events is disabled the matching lead gets immediately updated1 with the information coming from the prospect and its scores, according to the SW Studio Field Mapping records configured. If Match Leads via Platform Events is enabled the update1 is deferred and performed through the publishing and catching of a platform event (this system provides compatibility for org-code cannot run in a Batchable context).

1 If the lead gets successfully updated the prospect sync status gets set to Processed and will increment the Processed Attempts field by 1. If the update fails, due to validation rules or other errors, the prospect remains in status of Not Processed. The step will continue to try to match the prospect and the lead in any subsequent synchronization till the Processed Attempts field reaches the value of 30, after which the matching for the given prospect will be ignored. To be considered for matching again, the prospect will need to register an update in SalesWings, which in turn will trigger the GetProspects step for it and consequently have its Processed Attempts field value reset to 0.

2.103

MatchProspectsToContacts

See MatchProspectsToLeads. Instead of leads the step works on contacts.

2.103

CleanLeads

  • it disconnects - by removing any prospect data - the lead1 from any prospect that was marked as Merged or Deleted, or any prospect record that was physically deleted.

1 Only unconverted leads are considered by the process.

2.90

CleanContacts

See CleanLeads. Instead of leads the step works on contacts.

2.90

AggregateTags

  • if Account Aggregation is enabled, it aggregates all contact tags at their respective Account level via the saleswings__SW_Account_Tag_Segment_Trigger__c object.

2.62

AggregateScores

  • if Account Aggregation is enabled, it aggregates all contact scores at their respective Account level via the saleswings__Account_Score__c object.

2.62

AggregateTemperature

  • it assigns the median Temperature value at the Account level for its associated contacts.

2.80

CreateOpportunityTags

2.71

CreateOpportunityScores

2.71

DeleteProspectScores

  • it deletes any orphaned prospect scores1 (saleswings__Prospect_Score__c, this might be necessary in case a prospect is physically deleted, as the relationship between prospect and scores is of Lookup type).

1 Any contact/lead score is also automatically deleted (Master-Detail cascading effect).

2.62

DeleteProspectPages

  • it deletes any orphaned prospect pages (saleswings__Page_Prospect__c, this might be necessary in case a prospect is physically deleted, as the relationship between prospect and pages is of Lookup type).

2.62

DeleteRecordPages

  • it deletes any orphaned contact/lead pages1 (saleswings__Website_Visit__c).

1 Any contact/lead score is also automatically deleted (Master-Detail cascading effect).

2.119

Deprecated Steps

Name

Scope

Since

CountRecords

  • it counts he number of records in each of the SalesWings custom-objects and send the total back to SalesWings for monitoring.

2.118

MatchProspects

  • it matches by email address either contact or lead with the respective prospect.

2.103

DeleteProspects

  • it removes from the contact or the lead any prospect information if the prospect was marked as Merged or Deleted. This will be skipped if the setting Match Leads via Events or Match Contacts via Events.

2.119

DeleteContactPages

  • it deletes orphaned contact/lead pages

2.119

DeletePages

  • it deletes orphaned saleswings__Page__c records (which connect prospect pages to contact/lead pages).

2.119

Did this answer your question?