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 / I am getting runtime w...
Power Apps
Unanswered

I am getting runtime warning error. Can some one tell me what is wrong in my code?

(0) ShareShare
ReportReport
Posted on by 37

I am using below code in "Image" of Gallery items to display office 365 users profile pictures. _RequesterEmail is user email save as text in SharePoint point column. Error is in Attached file. Though, i can see profile pictures but the warning in very annoying as it shows to user every time they access the Power ApP page.

 

If(
Office365Users.UserPhotoMetadata(ThisItem._RequestorEmail).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem._RequestorEmail),
SAmpleperson

)

 

Error Message :  attached file.

Error.JPG
error in App.png
Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,844 Super User 2026 Season 2 on at

    Hi @FahadJaved212 ,

     

    These functions are very easily triggering errors, but those can be caught with the IfError function so users are not disturbed by them:

     

    IfError(
    	If(
    		Office365Users.UserPhotoMetadata(ThisItem._RequestorEmail).HasPhoto,
    		Office365Users.UserPhotoV2(ThisItem._RequestorEmail)
    	),
    	SAmpleperson
    )
  • FahadJaved212 Profile Picture
    37 on at

    Hi. Tried the code, and getting same error and this time there is no image in the image box as well.

     

    "The formula uses code which in not presently supported for evaluation."

    new capture.JPG
  • BCBuizer Profile Picture
    22,844 Super User 2026 Season 2 on at

    Hi @FahadJaved212 ,

     

    I did a quick test and got this to work with a slight modification:

    IfError(
     Office365Users.UserPhotoV2(ThisItem._RequestorEmail),
     SAmpleperson
    )

     

     

    BCBuizer_0-1686652825951.png

     

  • FahadJaved212 Profile Picture
    37 on at

    Hi @BCBuizer 

    If(!IsBlank(
    Office365Users.UserPhotoV2(ThisItem._RequestorEmail)),
     Office365Users.UserPhotoV2(ThisItem._RequestorEmail),
     SAmpleperson
    )

    This code works and above as well. How ever both code does not show sample image . What should i look into ?

     
     
    Sample image not show.JPG
  • BCBuizer Profile Picture
    22,844 Super User 2026 Season 2 on at

    HI @FahadJaved212 ,

     

    In your formula you refer to SAmpleperson, but I'm not sure what that is. Perhaps try replacing it with SampleImage.

     

    As you can see in my previous post, the sample image is showing for all items where Person is blank (bottom 3).

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard