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

Notifications

Announcements

No record found.

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,175 on at

    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

    This is perfect, thanks!!

  • Suggested answer
    Pradip Raj Profile Picture
    327 on at

    Expression are as below :

    pastedimage1625128110132v1.png

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

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

  • Nee2ok Profile Picture
    5 on at

    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

    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
    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
    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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 70

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans