cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
echodapogi
Resolver I
Resolver I

PowerApps Error Handling

Hello there, 

 

I am hoping this group can help me on this Error Handling issues. 

I have a gallery that displays users Picture profile. 

Code:  Office365Users.UserPhoto(ThisItem.RequestedbyEmail) 

 

the problem is if the users has no picture it has an a long error message on top. (see attached image). How can i change the error message on top to be custom. Like ("Error due to users have no profile picture") like that message. 

 

Like, ifError(Office365Users.UserPhoto(ThisItem.RequestedbyEmail), Notify("Error due to No Profile Picture") -- sample code

 

Thank you so much

 

-Echo

 
1 ACCEPTED SOLUTION

Accepted Solutions
pontusofsweden
Resolver IV
Resolver IV

Hi!

 

I think the error message is thrown by the connector so it´s not much to do about that. However, when I tried at my end I found out that instead of using Mail as a parameter, using Id works better. I.e

Office365Users.UserPhoto(ThisItem.Id)

 

This won´t cause any errors even if the user has no picture.  My suggestion is to use Id instead AND add a dummy picture in case there is no picture of the user.

 

BR

Pontus

View solution in original post

2 REPLIES 2
WarrenBelz
Super User III
Super User III

Hi @echodapogi ,

I am not a user of this facility, but will have a go at it.

 

If(
   !isBlank(Office365Users.UserPhoto(ThisItem.RequestedbyEmail),
   Office365Users.UserPhoto(ThisItem.RequestedbyEmail)
)
    

 

This hopefully should return nothing if not there. You can also try !isEmpty

 

 

Please click and accept as Solution if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

pontusofsweden
Resolver IV
Resolver IV

Hi!

 

I think the error message is thrown by the connector so it´s not much to do about that. However, when I tried at my end I found out that instead of using Mail as a parameter, using Id works better. I.e

Office365Users.UserPhoto(ThisItem.Id)

 

This won´t cause any errors even if the user has no picture.  My suggestion is to use Id instead AND add a dummy picture in case there is no picture of the user.

 

BR

Pontus

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,188)