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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 196 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 129

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans