Extract DomainName from email

Hello Community,

I would like to be able to extract the domaine name from an email.
Could you help me with the javascript needed please :


You don’t need the code node to achieve this, it can be done inside any parameter in any node via expressions. Simply use the extractDomain() function:

If you’re not seeing this function or are getting errors, first check if you’re on a new version of n8n (is a recently released functionality)


@TheG thanks a lot for marking my reply as a solution - it helps other folks discover it in future.

Below I’m just writing some keywords to help others find in future :slight_smile:

Domain name
Email extract
Root url
Split on email

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.