Extracting email domain from email address in a lead | Community
Skip to main content
February 28, 2017
Solved

Extracting email domain from email address in a lead

  • February 28, 2017
  • 1 reply
  • 1960 views

Hi,

I was curious if there is a best practice / process for extracting an email domain from a new lead.

I want to set the value, based on the email address entered, but couldn't find a specific function in the help section.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Thanks for moving and sorry for the delay!

Marketo doesn't offer this kind of parsing natively, but a scripting layer like FlowBoost* can do it easily in JavaScript:

var domain = ( {{Lead.Email Address}}.match(/@(.+)/) || ['N/A'] ).pop();

Just a little snippet that returns the domain or the string "N/A" if not found.  You could leave it blank instead... your call. You can also read about the extended FBEmail module, which does more than just parsing, over on the blog: http://blog.teknkl.com/flowboost-fbemail-for-domains/

* Yes, I'm the tech lead of FlowBoost and related SaaS stuff.

1 reply

SanfordWhiteman
New Participant
February 28, 2017

Hey Dan,

Please move the thread to Products​ and I'll answer it there. "Community" is for website feedback, not support -- and yes, this is confusing!

February 28, 2017

thanks... moved it over!

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
March 1, 2017

Thanks for moving and sorry for the delay!

Marketo doesn't offer this kind of parsing natively, but a scripting layer like FlowBoost* can do it easily in JavaScript:

var domain = ( {{Lead.Email Address}}.match(/@(.+)/) || ['N/A'] ).pop();

Just a little snippet that returns the domain or the string "N/A" if not found.  You could leave it blank instead... your call. You can also read about the extended FBEmail module, which does more than just parsing, over on the blog: http://blog.teknkl.com/flowboost-fbemail-for-domains/

* Yes, I'm the tech lead of FlowBoost and related SaaS stuff.