cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kenny_i
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
Jeff_Thorpe
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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,225)