Skip to main content

Summary

A Zap catches the TruAgents webhook, tidies the name and company, and finds or creates the Lead in Salesforce. Nobody writes code, and the Salesforce login stays in Zapier. This guide is step 2 of Send hot leads to Salesforce. Build the TruAgents workflow first.

Who this is for

An ops person with a Zapier account and a Salesforce user who can create and edit Leads.

Before you start

  • A Zapier plan that includes Webhooks by Zapier, a premium app. Check Zapier’s current plans.
  • A Salesforce connection in Zapier, using an integration user that can create and edit Leads.
  • TruAgents added to the Salesforce Lead Source picklist, or pick an existing value in step 5.
  • One real hot-lead event to build the Zap with (step 2 explains how to send one).
Zapier labels change from time to time. If a label doesn’t match exactly, look for the closest equivalent.

Build the Zap

1

Catch the webhook

Create a Zap. For the trigger, choose Webhooks by Zapier and the Catch Hook event. Leave Pick off a Child Key empty. Copy the webhook URL. It starts with https://hooks.zapier.com/hooks/catch/.
2

Send a sample from TruAgents

In TruAgents, open the workflow, click the Send webhook step, paste the Zapier URL into Endpoint URL, and click Save workflow. Set the workflow to Active and email your TruAgents inbox a hot-lead message from a test address.The Test Workflow tab never sends anything, so it can’t feed Zapier. If you’d rather not activate the workflow yet, POST the Example payload from the step to the Zapier URL with curl.Back in Zapier, click Test trigger. Pick the request that has data workflow name set to your workflow.
3

Split the name

Add an action: Formatter by Zapier → Text → Split Text.
  • Input: Data Contact Name.
  • Separator: [:space:].
  • Segment Index: All (as separate fields).
The first name is every segment except the last one, joined with spaces. “Mary Ann Smith” is “Mary Ann”, not “Mary”. For a two-word name, that is Item 1 alone. For a longer name, map the earlier items with a space between them and leave the last item out.For the last name, add a second Split Text with the same input and Segment Index set to Last. If Data Contact Name is empty, Salesforce still requires a Last Name. Add Formatter by Zapier → Text → Default Value, use that last segment as the input, and set the default to Data Contact Email.
4

Get the company from the email domain

Add another Formatter by Zapier → Text → Split Text.
  • Input: Data Contact Email.
  • Separator: @.
  • Segment Index: Last.
This gives acme.com for jane@acme.com. To drop the .com, add one more Split Text with separator . and Segment Index First.Company is required, so add Formatter by Zapier → Text → Default Value with the company split as the input and Unknown as the default. That covers an email whose domain doesn’t split. It does not cover a missing email: the next step stops those contacts before Salesforce.
5

Require an email

Add Filter by Zapier. Continue only when Data Contact Email exists.This Zap needs an email. Find Record searches by it, and a blank search fails before Create Salesforce Record if it doesn’t exist yet? can run, so the Company fallback never gets a chance to save the Lead. A contact with no email, such as one who only called or texted, stops here. Use the relay or Make if those contacts should become Leads. Both set Last Name and Company to Unknown when the name and the email are both empty.
6

Find or create the Lead

Add an action: Salesforce → Find Record.
  • Salesforce Object: Lead.
  • Field to Search By: Email.
  • Search Value: Data Contact Email.
  • Turn on Create Salesforce Record if it doesn’t exist yet? and fill in the Lead fields:
7

Optional: log each hot message on the Lead

Finding an existing Lead doesn’t update it. To give reps every new signal, add Salesforce → Create Record, object Task, with Related To set to the Lead ID from the previous step, and the message preview and conversation link as the description.
8

Test and publish

Test each action, check the Lead in Salesforce, then click Publish. Continue with Step 3: test and go live.

Failures and retries with Zapier

Zapier replies 200 to TruAgents as soon as it receives the request, before Salesforce is called. So:
  • TruAgents shows the Send webhook step as Succeeded, even if the Salesforce step fails later.
  • TruAgents never retries a lead that Zapier received. Salesforce errors show up only in Zap history.
  • Turn on Zapier’s error email notifications. On plans that include it, turn on Autoreplay so Zapier retries failed steps.
  • If the Zap is turned off, Zapier doesn’t run it. Leads sent while it’s off may need to be resent by hand.

Security

  • The Catch Hook URL works like a password: anyone with it can create Leads through your Zap. Share it only in the Send webhook step. If it leaks, create a new Catch Hook trigger and update the step.
  • Don’t add Salesforce credentials as headers on the Send webhook step. Zapier holds the Salesforce login.