cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
anuitz
Power Apps
Power Apps

UserProfile fails to find id for accounts with multiple ids

Using the Office365Users connection into power apps, using an email like John.Doe@microsoft.com as the search string in Office365Users.UserProfile("John.Doe@microsoft.com") fails because the user also has an alias email address (so Office365Users.UserProfile("jodoe@microsoft.com") works).

1 ACCEPTED SOLUTION

Accepted Solutions
Jeff_Thorpe
Super User
Super User

If you use the user's UPN it should work. It seems most companies use the user's email address as the UPN but some companies (like mine) use a unique id as the UPN. For my email could be Jeff@abc.com but my UPN is AZ247645@abc.com. So when we use the Office365Users.UserProfile() the value we have to use is "AZ247645@abc.com" otherwise if we use the email address "Jeff@abc.com" we get the message NoUser Found.

In your case maybe "jodoe@microsoft.com" is the user's UPN. 

 

FYI: UPN = User Principal Name



--------------------------------------------------------------------------------
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.

View solution in original post

4 REPLIES 4
Jeff_Thorpe
Super User
Super User

If you use the user's UPN it should work. It seems most companies use the user's email address as the UPN but some companies (like mine) use a unique id as the UPN. For my email could be Jeff@abc.com but my UPN is AZ247645@abc.com. So when we use the Office365Users.UserProfile() the value we have to use is "AZ247645@abc.com" otherwise if we use the email address "Jeff@abc.com" we get the message NoUser Found.

In your case maybe "jodoe@microsoft.com" is the user's UPN. 

 

FYI: UPN = User Principal Name



--------------------------------------------------------------------------------
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.

View solution in original post

You are definitely right that the alias email address is the UPN while the full.name email address is not and that is what is causing the issue.

 

Right now I am using the Office365.GetEventsCalendarView to get a list of meetings and their organizers (which I copy pasted from the Meeting Capture template). Unfortunately, the organizer field is an email address, which in my case is only occasionally the UPN. Is there a quick way of going from email address to UPN? Or a way of getting the UPN of the organizer from the GetEventsCalendarView?

I feel that there should be a better way to do this but here is my hack to get the UPN from the email address.

 

First(Office365Users.SearchUser({searchTerm:"EmailAddressGoesHere"})).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.

That is what I ended up doing but I feel like there should be a better way of going from calendar organizer to Office365 UserProfile. 

 

If anyone finds something better please post it! I'll mark your intial answer as the solution for now though. Thanks!

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

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

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

Top Solution Authors
Top Kudoed Authors
Users online (98,015)