cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Is it possible to get UPN of current user?

I'm building solution with PowerApps and Power BI. I try to build unified user access authorization defined in Azure SQL.

 

1) Power BI is using username() to get user by UPN format.

2) PoweApps is getting User().Email to get user by email format. 

 

Is it possible to have both solution using either email or UPN format for fetching current user?

 

Ken

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @kenny_i ,

 

Please see below video to show the options for Email().Email returning the UPN.

 

Let us know if you don't come right.

 

https://youtu.be/6FU1xGxJK5w

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.

View solution in original post

3 REPLIES 3
Super User
Super User

In PowerApps the User().Email actually returns the UPN and not the email address. In my company our UPN and email address are different, so I have had to work around this issue by getting the email address through the Office365Users connector. If you are worried about the User().Email being fixed to actually show the email address then you can use the Office365Users connector to get the email address or UPN for the current user.

 

Examples:

Office365Users.MyProfileV2().mail

Office365Users.MyProfileV2().userPrincipalName

 

 

 



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.

PowerApps User().Email do return email address to me. Also specs says that it should return email. address. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-user

 

PowerBI returns login.

https://msdn.microsoft.com/en-us/query-bi/dax/username-function-dax

 

I'm happy either way but trying to find way to authorize with PowerBI or PowerApss with same user identification.

Hi @kenny_i ,

 

Please see below video to show the options for Email().Email returning the UPN.

 

Let us know if you don't come right.

 

https://youtu.be/6FU1xGxJK5w

 

Dawid van Heerden
Follow on Twitter: @davestechtips
Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
**If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions.

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,351)