File contact sales form leads into Dynamics 365 without duplicates

By General Input

Every contact sales form submission lands in Dynamics 365 as a clean lead, updating the record you already have instead of creating a second one.

Integrations

  • Google Forms
  • Microsoft Dynamics 365
  • Slack

Type

Deterministic Code

Categories

  • Sales

Whenever someone submits our inbound contact sales form, I want this workflow to file the lead into Microsoft Dynamics 365 without ever creating a duplicate record. Trigger it by polling Google Forms for a new response on our contact sales form.

Start with the Google Forms Get Response operation to pull the full submission, and map the answers to first name, last name, email address, company name, phone number and the free text message the person wrote.

Before writing anything, check whether we already know this person. Run Dynamics 365 Query Records against the lead table with an OData filter matching the submitted email address, then run it again against the contact table with the same email filter. Run a third Query Records against the account table, filtering on the domain portion of the submitted email address, so we can tell whether the company is already a customer even when the individual is new to us.

If none of those lookups return a match, use Dynamics 365 Create Lead with the first name, last name, email, company and phone, and map the form's message into the description field.

If a lead or a contact already exists for that email address, do not create a second record. Use Dynamics 365 Update Record on the existing record instead. Refresh only the fields whose values actually changed, and append the new enquiry to the description field along with the submission date rather than overwriting what is already there.

When the account lookup matches an existing company, use Dynamics 365 Associate Records to link the new or updated lead to that account, so it routes to the territory owner who already manages that relationship.

Finish with the Slack Send a Message operation to post into our sales channel. The message should show the person's name and company, state clearly whether this was a brand new lead or an update to an existing record, note which account it was linked to when one matched, and list the answers they submitted.

Related prompts

Explore more prompts
Call overdue Xero customers with an AI collections agentWin back LiveChat visitors whose chats went unansweredChat quality review board for LiveChat support leadsWin back no-show and cancelled appointments every morningLive Loop returns analytics with product-level drill-downNewsletter pre-flight and approval board for Mailjet sendsTurn a prospect spreadsheet into personalized sequence enrollmentsMailjet email delivery lookup console for support teamsCatch feature flags that never got switched on in productionKajabi customer support console for member access fixes