Use Case: Create Lead or Update Contact 


In this Article
Related Articles

Overview

Duplicate records can be a common issue when dealing with Leads and Contacts.

How do duplicates happen?

Perhaps you're using a Web-to-Lead form. This type of form only creates Leads and usually does not check to see if a Lead already exists.

Another possible cause for duplicates could be that you've converted a previous Lead to a Contact. In this case, they should not be considered a Lead. Instead of creating a Lead for them, you can add an Event or Task to their Contact record.

But no worries. We can help! You can use the respondent's email address to search Salesforce for an existing record. If the respondent is already a Contact, you can update their information. If not, you can create a new Lead within the connector.

Below are instructions for both the form-native version of this solution and the workflow-native solution.


Form-Native Salesforce Connector Solution

When you are using the Form-Native Salesforce Connector, you can follow the steps below to update an existing contact record or update or create a lead record if no contact exists.

Update an Existing Contact

First, select to Update the Contact object. An email address is unique, so base your Lookup on the email address entered in the form. Match your selections with the example below:

  • If no matching record is found: Skip this object and any dependent. (We'll take care of this in the next step.)
  • If one matching record is found: Update record (default).
  • If more than one records are found: This depends on what you need.
    • For example, pick Create a new record if you have several contacts sharing the same email address. If you choose End execution and log an error, you or the respondent will be notified of an error, but the data won't be pushed to Salesforce.

Create a Lead When No Contact Exists

Now, we need to handle the opposite situation, where no Contact exists. In this case, we want to create a new Lead. To do this, we follow a similar pattern as above Lookup the Contact, but apply the opposite logic:

  • If no matching record is found: Continue with dependent objects.
  • If one matching record is found: Skip this object and any dependent.
  • If more than one records are found: Skip this object and any dependent.

Add a step to Update Lead object as a dependent object to the Lookup Contact, and match your selections with the above example.

Again, if the Connector doesn't find any matching Leads, or if it discovers multiple Leads, you can set it to update the most recently modified record. If only one matching Lead is found, that record will be updated with the mapped fields.


Salesforce Workflow Connector Solution

When you are using the Salesforce Workflow Connector, you can follow the steps below to update an existing contact record or create a lead record if no contact exists.

Update an Existing Contact

First, select to Update a Contact Record in your first action, then rename it to “Update Contact.” Use a unique identifier to base your Lookup Query on, such as an email address that is entered in the form. Then set your Match settings to the following: 

  • If no record found: Skip this action
  • If multiple records found: Pick most recently modified record

Finish mapping the form data to the Salesforce fields in the Mapping section that you’d like to update in the existing contact record.

Finally, under the Return Variables section, click Add Variable and map the contact ID to a workflow variable named “contactID.”

Your existing Contact Record will now be successfully updated with this first action!

Create a Lead When No Contact Exists

Now, when no contact exists, we want to create a new Lead record. To do this, we’ll add a second action to the connector and select to Create a Lead Record, then rename it to Create Lead. 

To this action, we want to add a precondition. This precondition allows us to state that this action should run only when the variable contactID is blank.

Finally, finish mapping your form data to the Salesforce fields in the Mapping section. 

This action is now set up and will only create a new Lead Record when there are no existing Contact records. 



Terms of Service · Privacy Policy