SOLVED

Extracting email domain from email address in a lead

Go to solution
Anonymous
Not applicable

Extracting email domain from email address in a lead

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.

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Extracting email domain from email address in a lead

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.

View solution in original post

3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Extracting email domain from email address in a lead

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!

Anonymous
Not applicable

Re: Extracting email domain from email address in a lead

thanks... moved it over!

SanfordWhiteman
Level 10 - Community Moderator

Re: Extracting email domain from email address in a lead

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.