cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jesslinc
Frequent Visitor

Office365Users.UserProfileV2 failed: { "statusCode": 404, "message": "Resource not found" } appearing at powerapps

Hi Community would need your help on this. 

 

Is it possible for the error mentioned above to NOT be displayed when the user is amending the data. 

 

So the code is stored in a label "Office365Users.UserProfile(TxtFNManagerEmail.Text).DisplayName" It reference from this text box " TxtFNManagerEmail" which Users can entered in. Before they complete typing in the Textbox, the error would always be prompted which result in a "false error"?

 

The reason I have this label is because I would like to capture the Name based on the email that was entered. Granted that might be invalid email but I have handled it separately in my app. I just do not wish for the error to appear above. 

powerappserror.png

Is it possible for it not to not to be appearing at all or display the error message shown in the powerapps? 

 
7 REPLIES 7
ZabiBabar
Continued Contributor
Continued Contributor

You can try this:

If(
  Not IsEmpty(Office365Users.UserProfile(TxtFNManagerEmail.Text)), 
  Office365Users.UserProfile(TxtFNManagerEmail.Text).DisplayName
)

 

v-yutliu-msft
Community Support
Community Support

Hi @Jesslinc ,

The reason why you met this error message is that:

if Office365Users.UserProfile function could not search any data by using TxtFNManagerEmail.Text, it will show this error message.

This a known issue.

You could try the formula that @ZabiBabar  provided:

If(!IsEmpty(Office365Users.UserProfile(TxtFNManagerEmail.Text)), Office365Users.UserProfile(TxtFNManagerEmail.Text).DisplayName)

However, you will still have this error message because you still need to run Office365Users.UserProfile function in the first part.

 

I'm afraid there's no solution to avoid this error currently.

I suggest you just ignore it. This error message does not really mean "error", your app's performance will not be affected.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
ZabiBabar
Continued Contributor
Continued Contributor

@v-yutliu-msft @Jesslinc What if we search for the user first and then get the user profile?

If(
  Not IsEmpty(Office365Users.SearchUser({searchTerm: TxtFNManagerEmail.Text})), 
  Office365Users.UserProfile(TxtFNManagerEmail.Text).DisplayName
)

Best,
Zabi
Mark this post as a solution, or kudo it if you found it be helpful. You can choose more than multiple answers as solutions, including your own answer. 🙂

Hey @v-yutliu-msft  Thanks for letting me know. It seems that I can't ignore it because in a user's perspective it would seems that there might an error. However what I did was to hide a field in another screen so this error will not appear in the same screen. It's not the best solution but I guess will have to make do it for now. 

ZabiBabar
Continued Contributor
Continued Contributor

Have you tried the formula I provided last?

Hi @Jesslinc ,

It seems that @ZabiBabar  provided a very good solution to avoid the error message.

However, he forgot "()" in his formula.

Try this:

 

If(
  Not(IsEmpty(Office365Users.SearchUser({searchTerm: TxtFNManagerEmail.Text}))), 
  Office365Users.UserProfile(TxtFNManagerEmail.Text).DisplayName
)

 

However, this formula still have some problems.

Please notice the parameter that Office365Users.SearchUser needs: display name, given name, surname, mail, mail nickname and user principal name.

the parameter that Office365Users.UserProfile needs: User principal name or email id.

 

Since Office365Users.SearchUser's parameter includes more types, so sometimes data in TxtFNManagerEmail has made the result of Office365Users.SearchUser not blank, but that data in TxtFNManagerEmail still not works for  Office365Users.UserProfile.

 

So there's very high possibility that you will have error message by using the above formula.

 

Maybe you could try to use Office365Users.SearchUser function instead of Office365Users.UserProfile function, which will not have error message and could get user's displayname too.

Try this:

First(Office365Users.SearchUser({searchTerm: TxtFNManagerEmail.Text})).DisplayName

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yutliu-msft / @ZabiBabar ,

 

Thank you so much for assisting me on this. Will try updating this to a search instead and let you know how it goes. 

 

I did try to just hide the field in another screen and pull the value through using another text. It's not the most efficient method but at least it seems to have prevent Users from seeing the error for now. I'll let you know once I get on updating the code. Thanks!

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (1,692)