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

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (4,148)