This is a step-by-step guide on how to implement the Leadspace Moved Flow which utilizes the Salesforce Flow Builder. The moved flow helps automate management of contacts and/or leads that have changed companies.
Concept
When a contact or lead is enriched through Leadspace for Salesforce, some records will return with an LS Person Verification Status of 'Moved'. This means the person at company A now works at company B. When Leadspace identifies a moved person record, we will try and provide the following data relative to the new company upon enrichment:
- LS Person Email
- LS Person LinkedIn URL
- LS Company Name
We can then use this data to build a flow in Salesforce that determines the next steps for these contacts and leads:
- If a new LS Company is found, create a new contact/lead record and disqualify the existing one
- If a no new LS Company is found, disqualify the existing contact/lead
You can then use the outcome of this flow to send the new contact records with new company data back through Leadspace enrichment through Leadspace for Salesforce.
Requirements
You must have System Administrator profile or a profile with permission to access, create, and manage Flows in Flow Builder.
Setup
We will be creating the Moved Contact flow here; repeat similar setup for the Contact/Lead object as needed.
Step 1: Record Triggered Flow
This is the triggering criteria that looks to see if a record has been marked as 'Moved'.
- Navigate to Setup > Quick Find > Search 'Flows', then click 'New Flow'.
- Select 'Record-Triggered Flow'.
- Name the flow: "LS Moved Contact Flow". Add a description if desired.
- Set flow to trigger when a Contact record is created or updated
-
Set Entry Conditions "All Conditions are Met (AND)"
- Field "LS Person Verification Status" Is Changed "True"
- Field "LS Person Verification Status" Equals "Moved"
- When to Run the Flow for Updated Records "Every time a record is updated and meets the condition requirements"
- Select Save
Step 2: Create Decision "Is Company Name on Moved Record?"
Next, we will create a decision to determines whether moved contacts have a new, LS Company Name value or not.
- Select the + sign and add an element Logic > Decision
- Add Label "Is Company Name on Moved Record?". Add description as needed
- OUTCOME DETAILS Label should be "Company Found"
- Condition Requirements to Execute Outcome "Custom Condition Logic is Met"
- Condition Logic is 1 AND 2
- "Triggering Contact > LS Company Name" is Changed "True"
- "Triggering Contact > LS Company Name" Is Null "False"
- When to Execute Outcome "If the condition requirements are met"
- In the Outcome Order section on the left, click the second option
- Rename Label "Company Not Found". This will be the alternative decision should records not quality for "Company Found"
- Select Save
Step 3: Company Found > Create Decision "LS Person Email Found"
When LS Company Name is provided on the Moved record, we then need to add a second decision to determine whether a new, LS Person Email value was provided on the record.
- Select the + sign and add an element Logic > Decision
- Add Label "LS Person Email Found". Add description if needed
- OUTCOME DETAILS Label should be "LS Person Email Found"
-
Condition Requirements to Execute Outcome "All Conditions are Met (AND)"
- "Triggering Contact > LS Person Email" Is Changed "True"
- "Triggering Contact > LS Person Email" Is Blank "False"
- When to Execute Outcome "If the condition requirements are met"
- In the Outcome Order section on the left, click the second option
- Rename Label "LS Person Email Not Found". This will be the alternative decision should records not qualify for "LS Person Email Found"
- Select Save
Step 4: LS Person Email Found > Create New Contact
When both the LS Company and LS Person Email are found on the original moved contact, we now need to create a new contact that includes data from the original plus some new data. This is the new contact that will be created with the new company, new email address, and the LinkedIn profile provided by Leadspace on the original contact so it can be re-enriched through the application.
- Select the + sign and add element Create Records
- Add Label "Create New Contact - Moved". Add a description as needed
- How to set record field values "Manually"
- Object "Contact"
- Set Field Values for the Contact as instructed in the table below:
| Field | Type | Value |
| Account ID | Triggering Contact | Account ID > Account ID |
| Last Name | Triggering Contact | Last Name |
| First Name | Triggering Contact | First Name |
| Lead Source | Picklist | Leadspace |
|
Step 4: Triggering Contact Step 5: Formula |
Step 4: LS Person Email Step 5: |
|
| LS Person LinkedIn Profile | Triggering Contact | LS Person LinkedIn URL |
| Status | Picklist | Open |
| Notes | New Resource > Formula | "New Contact created from a moved Contact. Old Contact record https://[yourSFDC_URL]/lightning/r/Contact/&[Contact].Id" |
The Notes field must be created as a 'New Resource > Formula'. This is to add a note in the new record that references the original, moved record and should contain your top-level SFDC URL plus the Contact ID.
- API Name is "new_record_notes". Add description as needed
- Data Type "Text"
- Formula should be the text you want including your top level SFDC domain and a link for the contact ID.
- Select Done
- Select Save
Step 5: LS Person Email Not Found > Create New Contact
When LS Company is found but LS Person Email is not on the moved contact, we still create a new contact but with a slight different list of fields. All of the fields from the table in Step 4 are the same except for 'Email'. When LS Person Email is not provided, we must create a temporary email address to satisfy MAP requirements in most cases.
- Copy the Create New Contact element from Step 4
- Select the + sign under the LS Person Email Not Found decision and choose Paste Element
- Rename the element Create New Contact - Moved2
- Instead of setting the Email field to LS Person Email, change the value to New Resource > Formula > "[Contact].FirstName.[Contact].LastName@temporaryemail.com".
- API Name to "temp_email". Add description as needed
- Data Type is "Text"
- Formula is "[Contact].FirstName.[Contact].LastName@temporaryemail.com"
- Select Done
- Select Save
Step 6: LS Person Email Found & Not Found > Update Original Moved Contact
This step is a mirror on both decision branches; LS Person Email Found and LS Person Email Not Found. Here, we are disqualifying the original Moved contact.
- Select the + sign under the Create New Contact element
- Choose the Update Triggering Record element
- Label "Update Original Moved Contact". Add a description as needed
- How to Find Records to Update and Set Their Values "Use the contact record that triggered the flow"
- Set Filter Conditions "None--Always Update Record"
- Set Field Values for the Contact Record
| Field | Type | Value |
| Contact Status | Picklist | Disqualified |
| Disqualified Reason | Picklist | No Longer with Company |
| Title | Formula | "[Contact].Title& - No Longer With Company" |
- As with the temp_notes and temp_email formulas above, Title is created as a New Resource > Formula in the Value field
- Select Done
- Select Save
- Copy this element and select the + sign below the Create New Contact element under the LS Person Email Not Found decision
- Paste the element. Note you must change the Label value to something like "Update Original Moved Contact2" since the original name is taken
- Select Save
Step 7: LS Company Not Found > Update Original Moved Contact
For this step, we are going to make another copy of the Update Original Moved Contact element and place under the LS Company Not Found decision determined after Step 2.
- Copy the element Update Original Moved Contact
- Select the + sign under the Company Not Found
- Paste the element. Note you must change the Label value to something like "Update Original Moved Contact3" since the original name is taken
- Select Save
Step 8: Create Notification to Internal Teams
There are several ways to create notifications and alerts via the Flow Builder, so this step is more a matter of personal preference. For this tutorial, we are creating a simple "Send Email" element that goes to the Account Owner and our Sales Leader and notifies them of the original moved contact, and the new contact created as applicable for the decision branches to which they are added.
You can also create Chatter Activities, Custom Email Notifications, and Tasks if you so desire. Please consult with your Sales Ops, Marketing, and Salesforce System Administrator Teams on how to set this final step to suit you best.
- Click the + sign under the elements added to the Company Found decision branch
- Add element Send Email
- Label "Notify Contact Owner"
- Add any CC emails or collections or BCC emails or collections as needed
- Configure Sender Details if you want to determine the sender type and sender email address
- Configure Email Content: Here you can use an existing email template, or compose email content ad hoc
- Add Subject, Body, and Insert Resources as needed for the email
- Select Save
- Copy the Notify Contact Owner element
- Go to the Company Not Found branch and select the + sign under the Update Original Moved Contact 3 element
- Paste the element. Note you must change the Label value to something like "Notify Contact Owner2" since the original name is taken
- Select Save
Final Flow Version
Once your flow is completed, it should look similar to the first screenshot in this article. Depending on your company and team needs, it may vary based but the core flow should operate as shown.
If you would like more information or have questions about setting up this flow, please reach out to your CSM or support@leadspace.com