And that’s my fault. This year’s resolution was to document more of FlowBoost’s secret functions — the “macros,” if you will, that are built-in so you don’t have to write them in pure JS.

But it’s already June. Oops.

Anyway, a few such macros are offered by FBUtil.string. It’s this easy to return just the domain example.com from sandy@example.com:

let emailParts = FBUtil.string.partsFromEmail({{lead.Email Address}});
var emailDomain = emailParts.domain;

The full setup:

## Campaign setup

Then — you probably know this part — have a campaign that’s requestable (for your initial backfill batch) and also triggers on Person is Created and change of address:

Note: I purposely don’t check if Email Address was empty, since when it changes to empty, you want to empty out Email Domain, too. (If you really wanted to conserve FlowBoost calls, you could cover that particular case with Add Choice and Change Data Value, but that’s more complicated.)

Then you’ll have example.com stowed in a field and can use it in Smart Lists, Reports, and so on. You can also use it to look up the MX record and get some additional insights into your leads: that’ll be the next post.