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 Apps / Office 365 user profil...
Power Apps
Answered

Office 365 user profile failed

(0) ShareShare
ReportReport
Posted on by 51

I am using this code below 

 

First(Office365Users.UserProfile(_selectedUser.Mail).BusinessPhones).Value

 

And I am getting this error when running the app. 

 

SShulaw_0-1679935738447.png

 

 

I have tried to write a If(!isblank code.... but I have been unsuccessful. 


Can someone assist with this? I know this is a known bug, but that error message is daunting. 

 

 

 

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    Hi @SShulaw ,

    The code is valid as below - I got my phone number - you might have a look at the validity of _selectedUser.Mail

     

    WarrenBelz_0-1679955792463.png

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • SShulaw Profile Picture
    51 on at

    Yes, it is working to retrieve the number as intended, but not without the error. 

     

    So I attempted to do something similar to the solution from this thread:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/the-service-returned-an-error-Office365Users-UserProfile/td-p/32972

     

    however, I cannot get the If(!IsBlank to cooperate with the other code to still pull the number. The furthest I have gotten is to get the field to display a true/false. 

     

  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    @SShulaw ,

    Just to be clear, you are saying 

    _selectedUser.Mail

     returns a valid email address and 

    First(Office365Users.UserProfile(_selectedUser.Mail).BusinessPhones).Value

    returns an error. If so, sorry, I cannot reproduce that here.

  • SShulaw Profile Picture
    51 on at

    Yes. So I am using the "MyPeople" connector or "People Picker" I have heard some people call it. Once that person is selected, they are then the "_selectedUser". 

     

    SShulaw_0-1680266893793.png

    SShulaw_1-1680267014638.png

     

     

  • SShulaw Profile Picture
    51 on at

    SShulaw_2-1680267244836.png

    And to be clear, the error only shows up when there is not someone selected. Hence why I was trying to do a If(!IsBlank 

     

  • Verified answer
    WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at

    @SShulaw ,

    You need something like

    If(
     !IsBlank(_selectedUser.Mail),
     First(Office365Users.UserProfile(_selectedUser.Mail).BusinessPhones).Value
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • SShulaw Profile Picture
    51 on at

    YES! This worked perfectly! Thank you so much. 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard