Best answer

Extracting a new lead name from an email

  • 10 July 2020
  • 3 replies
  • 2545 views

I’m working through a new ZAP.

New leads (O365 email) trigger will eventually to create a contact and initiate a lead intake workflow:

  1. Office 365 email hits Lead Folder
  2. Formatter I’m trying to extract the lead name (not email address, that would make life so easy) from the content of the email address.
  3. Once I’ve isolated the leads name, I’d like to verify that lead with our CRM wealthbox, (Find/ create contact)
  4. From there, I’d like to start a workflow within wealthbox to intake the lead.

Can you advise a best practice that allows us to gather just the new lead name data in an HTML formatted email?

Thank you!

 

icon

Best answer by nicksimard 16 July 2020, 20:53

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +11

Hi @jec!

That’s going to depend on how the data shows up in your email. If it was something like this:

Name: Jane Doe
Title: CEO
Age: 39

You could use a Formatter step (Text — Split Text) and choose the : to split on, selecting All (as Separate Fields) for the Segment Index. That would give you the first and last name as separate fields, which you could then map into a search field. If there’s a plain text field, or maybe even a body preview field, you could avoid having to remove the HTML formatting. That’s not necessarily ideal if you’ve got middle names.

Another approach would be to use an Email Parser if you’re always going to receive emails in the same format (like if my emails always came in with the format I showed above, for example).  Zapier offers a free email parser: https://zapier.com/apps/email-parser/integrations.

You have those emails forwarded to the parser, you indicate which parts you want to extract and then on later steps of your Zap you can map those into fields.

More info on the Email Parser: https://zapier.com/help/create/email-and-text-messages/set-up-your-email-parser-account-in-zapier

The important part is having a way to automatically send those emails to the email parser, either directly from the source (if they're notifications, for example) or setting something up within the email app that's currently receiving them, to have them forwarded.

Hope that helps!

 

Hi,

I am trying to extract the name Dave Lee into First Name: Dave and Last Name: Lee from the below standardized email string. 

 

Appreciate your kind advice on how I can do this. Thank you. 

 

“Hi KK, Someone filled out the form (None) on your website: http://value.com.sg The following data was submitted: Dave Lee kxxxxxxx@gmail.com ☐ add-me-to-your-mailing-list I would like to”

Userlevel 7
Badge +12

Hi@KenKKK 

If the text is all in one string and doesn’t have any line breaks then your best bet here would be to use the Formatter > Split text function. 

In the Split text step, type [:space:] for the separator, which will split the text wherever there is a space, ie by every separate word. Then, as Nick said, you would use the segment index option ‘All as separate fields’ which will give you each word as a separate field. You can then choose the first name and last name to add to Wealthbox. 

Two very important things to note here: this will only work if the message has exactly the same number of spaces each time and the lead only has a first and last name (ie no middle name or more than one text string in the surname)

 

You can make the process more reliable by having two split text steps. 

For the first Split text step, use the separator : and choose ‘last’ for the segment index. That will take the whole message and change it to just

Dave Lee kxxxxxxx@gmail.com ☐ add-me-to-your-mailing-list I would like to

 

Then add a second Split text step that uses [:space:] for the separator and select ‘all as separate fields’ for the segment index. In the Wealthbox step, select the first piece of text as the first name and the second as the surname. 

Using two split text steps means that there will be less chance of error, but again it will only work if there’s no middle name. 

 

I hope that helps 🙂