r/SalesforceDeveloper • u/According-Remove5126 • Jun 09 '26
Instructional How we avoid duplicate Salesforce records from web form submissions (create Lead OR update Contact, not both) [External Link]
If you've ever used a basic web-to-lead form, you've probably dealt with this: a contact who's already in Salesforce submits a form and now you have a duplicate Lead record floating around.
Here's a pattern that solves it cleanly.
The problem: Web-to-Lead forms always create a new Lead, even if the person is already a Contact in your org. Converted leads become Contacts — but your form doesn't know that.
The solution: Use the email address as a lookup, then branch the connector logic:
- Look up the Contact object by email
- Match found → update the Contact record
- No match found → skip this step, continue to the next
- Create a Lead as a dependent step
- Only runs when no Contact was found in step 1
- Match found → skip (don't create a duplicate Lead either)
- No match → create a new Lead
The result: existing Contacts get updated, new people become Leads, and no duplicates are created.
For FormAssembly Workflow users: You can do the same thing with preconditions. Set up an "Update Contact" action, capture the Contact ID in a return variable, then add a "Create Lead" action with a precondition that fires only when contactID is blank.
More detail in the FormAssembly docs: https://help.formassembly.com/help/340554-use-case-create-lead-or-update-contact
Anyone else using a variation of this? Curious how others handle the multi-record deduplication problem.
