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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Remove domain from use...
Power Automate
Unanswered

Remove domain from user principle name

(0) ShareShare
ReportReport
Posted on by 68

I am trying to build a flow that uses the get user profile (v2) module and only want to pull the user's username from the system. I would like to remove the @xxxxx.com from the user principal name dynamic content and add it to a column in a sharepoint list. How would I do that? 

Categories:
  • David- Profile Picture
    1,254 on at

    You basically want to split the e-mail address into two parts; the address and the domain. You can use the split expression to do this, which will generate an array with two outputs. You can then reference each one of theses through the expression in the compose actions.

    Web capture_20-9-2022_1391_make.powerautomate.com.jpeg

    The expression used in each of the above are:

    1. split(outputs('Get_user_profile_(V2)')?['body/mail'],'@') - splits the e-mail address at the @ symbol
    2. outputs('Compose')[0] - gets the first item from the split (the e-mail address)
    3. outputs('Compose')[1] - gets the second item from the split (the domain)
  • cdmcali Profile Picture
    68 on at

    Here is what happened: Screenshot at Sep 20 10-27-26.png

     

    It put thi sin my sharepoint list: outputs('Compose')[0]

  • cdmcali Profile Picture
    68 on at

    Is this setup right? Screenshot at Sep 20 10-33-43.png

  • cdmcali Profile Picture
    68 on at

    I see what I was doing wrong but still not getting the right result: Screenshot at Sep 20 10-39-07.png

     

    Output: split(flowiitsautomation@XXXXX.edu,'@')[0]

  • cdmcali Profile Picture
    68 on at

    I see what I was doing wrong now. I was not using the expression. Thanks!

  • David- Profile Picture
    1,254 on at

    You need to use the expression builder for the formulas in each of the compose actions. If you have done it correctly, the Inputs will look like the image I posted with a pink box with fx at the beginning. When you click on the input box it should open this menu:

    David_0-1663767026807.png

    You need to click on Expressions and enter the formula in the fx box. As you build it, you can switch to the Dynamic content tab to get the e-mail field, etc. The three expressions you need:

    1. split(outputs('Get_user_profile_(V2)')?['body/mail'],'@') - splits the e-mail address at the @ symbol
    2. outputs('Compose')[0] - gets the first item from the split (the e-mail address)
    3. outputs('Compose')[1] - gets the second item from the split (the domain)

    As long as you did not rename the Get user profile action, and don't rename your first compose action, the bold text above is what should work in the expressions.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 299

#2
11manish Profile Picture

11manish 274 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard