· tutorials · 3 min read

Convert Related Records from Leads Using Flow

Learn how to migrate your related records from Lead to Contact on conversion.

Tracking data throughout a sales cycle in Salesforce is essential to getting the most out of a Salesforce implementation. Companies looking to track extra data through lead conversion can use related objects to store information. This often comes in the form of custom note objects, form submissions, and more. The downside of this approach is that related records are not automatically associated with the newly created contact after converting a lead. Using flows, we can easily associate the related records to a lead to the newly converted contact.

Data that comes in a repetitive manner is better suited to be stored in related objects. This could be form submissions from a website form, a custom note object, or other data that can easily be tied to a specific date/time. Using this approach to store data reduces the amount of repetitive custom fields, like submission 1 date, submission 2 date, etc.

Configuring the Flow

To show how easily this can be built, we will walk through how to configure this using the custom object Website Submission, a related object to the lead.

Custom Object Configuration

Ensure that that following is present in the custom object:

  • Lookup Relationship to the lead - This will be stored in the field Lead__c
  • Lookup Relationship to the contact - This will be stored in the field Contact__c

Creating the Flow

Create a new flow with the type - Record-Triggered Flow.

Additionally, use the following configuration:

  • Object: Lead
  • Trigger the flow when: A record is updated
  • Condition Requirements: isConverted = True
  • When to Run the Flow for Updated Records: Only when a record is updated to meet the condition requirements
  • Optimize the Flow for: Actions and Related Records

Flow Entry Conditions

It is also considered best practice to save your work frequently. Save the flow with the following properties:

  • Flow Label: Lead Conversion Flow
  • Flow API Name: Lead_Conversion_Flow

Because the Website Submission records are related to the lead that started the flow, retrieving, modifying, and updating the related records can be achieved using the same element. To update these website submission records with the newly converted contact ID, add a Update Records element with the following properties:

  • Label: Update Website Submissions
  • API Name: Update_Website_Submissions
  • How to Find Records to Update and Set Their Values: Update records related to the lead record that triggered the flow
  • Records Related to Lead: {!$Record.Website_Submissions__r}
  • Fields to update: Contact__c < {!$Record.ConvertedContactId}

Update Records Element

And that’s all that is needed to convert related records from a lead and associate them with a converted contact. Activate the flow and starting related records to contacts immediately!

Entire Flow

Need Our Help To Get Your Data Into Salesforce?

Join dozens of other companies by learning how you can get all your company's data in one place.

Back to Blog