Get only email domain

Hello, community,

I have a workflow where i am fetching data one of the keys is an email. What i want to do is only to get the domain of the email and not the client, then save it in my google sheets.

My problem is how do i automate that i only get the domain of the email and not the whole email?

I am using the SET node to only get the email key, but then i am not sure how to automate the process of only getting the domain.

Hope i made sense!

Thank you.

Hello @alex_jones and welcome to the community :tada:,

In your set node you can use this expression:

{{ $json[“email”].split(“@”)[1] }}

This should do it.

3 Likes

Hey @rdt , thank you for your answer, but I am afraid it is not working. In the result it is saying not found in red.

Any ideas?

Hey @alex_jones,

Can you share the workflow so we can take a look? I suspect it is going to be a case of updating the expression to match you input field names

1 Like

Hi @Jon it is working now problem was i copied and pastes the expression but my key was with an uppercase E-mail not email and now it is working. I didnt see it at first.

1 Like

Hey @alex_jones,

That is handy :slight_smile: thanks for the update.