Default settings in Salesforce do not associate leads with accounts. Our team, however, encourages our clients to change this within their own implementations, especially if they operate within a B2B business model.
The benefits of setting up this relationship include:
- Keeping your CRM data clean and organized
- Reducing inaccurate lead data by filtering out leads with personal domains (Gmail, Yahoo, etc.)
- Increasing BDR efforts by providing them with a clear picture of their target audience: brand new leads vs. leads for existing business
- Improving marketing campaigns by identifying leads of net new business
How to Match Leads to Accounts in Salesforce: A Simple Method
Now that we know the benefit of matching Leads to Accounts, let’s review our simple implementation method.
We will need:
- Formula field
- Look up field
- Flow
Let’s dive in!
Setting Matching Criteria
First, we need to set some matching criteria. What can help us identify that the lead matches our existing account?
The most used criteria are going to be matching the account website with the lead’s domain. To extract the lead’s domain, let’s create a formula field:
Go to the Object Manager -> Lead -> New Field-> Formula -> Text
Let’s call it “Domain.” Paste the code into the body of your formula field:
SUBSTITUTE(Email, LEFT(Email, FIND("@", Email)), NULL)
Your field should look like this:
Add this field to the page layout to verify that it is working as expected. You can also add it to one of the listviews that you personally use so that you can quickly verify it for multiple records:
Create a Look Up Field
Now, let’s create a lookup field to the Account on Lead object. Go to the Object Manager -> Lead -> New Field-> Lookup -> Account. Then, add the field to the page layout.
Create Your Flow
Finally, let’s create a flow that will help us match and relate Leads to Accounts. This will be a record-triggered flow:
Go to the Object Manager -> Search Flow -> New Flow-> Name the flow
Depending on your Lead process, you can trigger this flow on Create or Edit or both. If you find that you make a lot of changes to the email addresses after leads are created, I recommend triggering the flow when a lead is created or updated. Otherwise, created will suffice.
We don’t want the Lead record to trigger the flow if they don’t have the email address listed. Therefore, the trigger condition should be where the email address isn’t blank, as per the screenshot:
Finding a Match
Now, we will search for All Accounts using “Get Element” to find a possible match. If you don’t have a separate domain field on the Account, you can try using the standard Website field to match the lead’s domain. Alternatively, if you have extracted the domain on the Account and Lead, you can update the criteria to your custom field and use the “Equals” operator instead for a more accurate match.
Adding a Decision Element
Now, we need to add a Decision element to check if any account was found in the previous step.
If the Account from Get_Accounts is not blank, we’ll know that the match is found. If it is blank, no was match found.
If a match was found, we want to update the Account lookup field with the Account ID that was found in the Get Element. To do that, we need to add Update Records Element:
If there is no match, we will end the flow.
The final flow should look like this:
Debugging and Activating the Flow
You can now debug and activate the flow!
By adding a Leads-related list to the Account page layout, you can see all the leads that were automatically related.
Further Customizing Your Salesforce Solution
Our team helps organizations customize their Salesforce implementations with changes like this, as well as with much more complex functionality enhancements. If you want to do more with the platform, we can support you through the process through tailored consulting and development services. Contact our team today to talk to a consultant about your goals on Salesforce.