web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Need help parsing the domain of an "Email" field and saving it to a separate field

(0) ShareShare
ReportReport
Posted on by

Hello,

I want to parse the domain portion of an "Email" field and save it as a separate domain field.  For example, An email of "johnsmith@yahoo.com" will get saved to a "Domain" text field as "yahoo.com".  How can I do this?

Thanks!

I have the same question (0)
  • Verified answer
    MikeC282 Profile Picture
    2,171 on at
    RE: Need help parsing the domain of an "Email" field and saving it to a separate field

    For an out of the box method, you can use Power Automate which is essentially going to replace workflows. I've created a dummy Flow with a single email address of "test@hotmail.com"

    In the last step I took the email and performed a Flow expression to split the string by the "@" value and then extract the last item of the returned array. You'd obviously replace the first compose step with a CDS Flow step to extract an email from a CRM record but the second step where I transform it in the second compose still applies.

    pastedimage1583293357747v1.png

    1. This will be whatever step in which you'll get the email address from.

    2. This uses the below expression to split the email into a array and then extract the last portion (the domain).

    Below is the result:

    pastedimage1583293496254v2.png

    --------------------------------------------------------------------------------------------------

    If this answers your question, please mark it as a suggested answer

  • Community Member Profile Picture
    on at
    RE: Need help parsing the domain of an "Email" field and saving it to a separate field

    This is perfect, thanks!!

  • Suggested answer
    Pradip Raj Profile Picture
    327 on at
    RE: Need help parsing the domain of an "Email" field and saving it to a separate field

    Expression are as below :

    pastedimage1625128110132v1.png

    last(split(triggerOutputs()?['body/sender'],'@'))

    Where From = triggerOutputs()?['body/sender']

  • Nee2ok Profile Picture
    5 on at
    RE: Need help parsing the domain of an "Email" field and saving it to a separate field

    I need help to extract the first part of the domain of an email address, capitalize it and save to a different column.

    For example, email address = test@gmail.com.

    I want to use Power Automate to extract the "gmail" value and capitalize it as "GMAIL" and save it to column called "Title".

    The data source is a Microsoft Form.

    Any assistance is very much welcome. Thanks

  • Suggested answer
    Pradip Raj Profile Picture
    327 on at
    RE: Need help parsing the domain of an "Email" field and saving it to a separate field

    Hello,

    last(split(triggerOutputs()?['body/sender'],'@'))

    We can use above expression to get the gmail.com then need to use the same expression with different syntex to get the "gmail" value. We can use first() instead of last() to get the GMAIL value. Please use below links for more details.

    zeitgeistcode.com/.../

    www.youtube.com/watch

    Or use below

    String = 'test@gmail.com"

    first(split('test@gmail.com','.')) = 'test@gmail'

    last(split('test@gmail'),'@') = 'gmail'

  • AdrianQ9 Profile Picture
    4 on at
    Need help parsing the domain of an "Email" field and saving it to a separate field
    How would you write the syntax if you wanted the end value to say simple "hotmail" and remove the ".com"
  • AdrianQ9 Profile Picture
    4 on at
    Need help parsing the domain of an "Email" field and saving it to a separate field
    Never mind I just created another Compose with the value:
     
    split(outputs('Compose_2'), '.')[0]
     
    then made THAT Compose the value I reference. 

     
     
    Hope this helps anyone else out there! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Rishabh Kanaskar Profile Picture

Rishabh Kanaskar 247

#2
Tom_Gioielli Profile Picture

Tom_Gioielli 166 Super User 2025 Season 2

#3
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 164

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans