Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Office365Users.UserProfileV2 runtime error

(0) ShareShare
ReportReport
Posted on by 306

Hi,

 

I have an app where I fetch some information about a user based on a text field. My formula looks like this:

 

Office365Users.UserProfileV2(txtUserInitials&"@blahbalh.com").displayName

 

Even though it works and fetches the data as expected, it get this runtime error in the app:

 

Office365Users.UserProfileV2 failed: { "error": { "code": "ResourceNotFound", "message": "User not found", "innerError": { "date": "2020-11-12T08:00:32", "request-id": "XXXXXX", "client-request-id": "XXXXXX" } } }

 

Is there anyway I can avoid this error?

Categories:
  • ganeshsanap Profile Picture
    1,551 on at
    Re: Office365Users.UserProfileV2 runtime error

    @NielsL It is throwing this runtime error because either you are passing blank txtUserInitials or wrong UPN/Email to UserProfileV2 function.

     

    If you want to search the users then I will recommend you to use SearchUser() function instead of UserProfileV2().

    Check below documentation for more information on SearchUser() function:

    Additional referenceCREATE AN OFFICE 365 USERS LISTS AND SEARCH A USER 


    Please click Accept as solution if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍

     

  • CU-18081211-6 Profile Picture
    9,266 Super User 2025 Season 1 on at
    Re: Office365Users.UserProfileV2 runtime error

    Hi @NielsL,

    Is txtUserInitials a variable ?

    If so, based on your info, I think that this formula should get rid of the error:

    If(IsBlank(txtUserInitials),"",Office365Users.UserProfileV2(txtUserInitials&"@blahbalh.com").displayName)

     

    Hope it helps !

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1