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 Apps
Answered

user photo warning

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello family,

I have created an application with profile pictures and here is the formula  : 

 

If(IsBlank('Utilisateursd’Office365'.UserPhoto('Utilisateursd’Office365'.UserProfile(ThisItem.User).Id));
SampleImage;
'Utilisateursd’Office365'.UserPhoto('Utilisateursd’Office365'.UserProfile(ThisItem.User).Id))

 when I share the application and when I navigate in the application I always get the following warning message : 

FAIZ_ext_0-1651742936737.png

 


how to solve this please

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
    If(IsBlank('Utilisateursd’Office365'.UserPhoto(User().Email));
    SampleImage;
    'Utilisateursd’Office365'.UserPhoto(User().Email)

    Try it like that

  • RusselThomas Profile Picture
    4,014 on at

    Hi  @Anonymous,

    I'm guessing this is failing because the userID is empty or doesn't exist, not because there isn't a photo to display.  You can check and test for both using the userProfile and UserPhotoMetadata methods.

     

    Perhaps add a label somewhere in the row that resolves the user id so you can see what it looks like;

     

     

    'Utilisateursd’Office365'.UserProfile(ThisItem.User).Id

     

     

    Either way, try testing the userID before calling the O365 users method to make sure it exists, then check for the photo, then render;

    eg:

     

     

    If(
     !IsBlank('Utilisateursd’Office365'.UserProfile(ThisItem.User).Id); //make sure user exists
     If(
     'Utilisateursd’Office365'.UserPhotoMetadata(ThisItem.User).HasPhoto = true;
     'Utilisateursd’Office365'.UserPhotoV2(ThisItem.User);
     SampleImage
     )
    )

     

     

    By the way, if you're using ThisItem.User as UserId input into 'Utilisateursd’Office365', you don't then have to go and fetch the Id to use as input into 'Utilisateursd’Office365'.  You just check the Id in the beginning to make sure the user exists.

    Generally these days just making sure the user id exists is enough and you can still show user records that have no image without getting an error, so you can also try;

     

    If(
     !IsBlank('Utilisateursd’Office365'.UserProfile(ThisItem.User).Id);
     Office365Users.UserPhotoV2(ThisItem.User);
     SampleImage
    )

     

    but if you're picking up errors with users that have no photo then try the UserPhotoMetadata() check as well.

    Let me know how it goes.

     

    Kind regards,

    RT

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RusselThomas 

    Hello ;

    Thanks for your feedback and your formula
    even with the formula I always detect error /wirning with users who do not have photo at the time I share the application and navigation

    how can I check UserPhotoMetadata(). you mean exactly?

    Thanks again

     

  • RusselThomas Profile Picture
    4,014 on at

    Hi @Anonymous ,

    'Utilisateursd’Office365'.UserPhotoMetadata(ThisItem.User).HasPhoto = true;

    This method should pull a record containing information about the user photo, whether or not they have a photo, without errors.  The record contains a field called HasPhoto which is true or false. 

     

    If you call this, it should tell you whether there is a photo or not before you try calling UserPhotoV2().

    It's supposed to avoid errors when there is a user record but no associated photo to render.

    If you call this by itself and get an error, then you need to check your userId.

     

    Can you share some more about the controls you're using or some screenshots?

    Are you using a Gallery, or a form or just controls on a page?

     

    Kind regards,

    RT

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi @RusselThomas ; 

    FAIZ_ext_0-1651759192898.png

    There is a similar thread which resolved the error by putting a if condition around the ID and then referring to the same ID in office365 connector.
     

    but I don't know how I can adapt it to my situation thank you very much




  • RusselThomas Profile Picture
    4,014 on at

    Hi @Anonymous ,

    I don't see an error on your screenshot?  Is it still not working?

    Kind regards,

    RT

  • Verified answer
    JimmyW Profile Picture
    2,567 on at

    https://powerusers.microsoft.com/t5/Building-Power-Apps/UserPhotoMetaData-When-user-leaves-the-company/m-p/1560772#M401646

     

    Suppress error message.

     

    If(
    !IsBlank(ThisItem.'Requested By'.Email),
    If(
    IfError(Office365Users.UserPhotoMetadata(ThisItem.'Requested By'.Email).HasPhoto, ""),
    IfError(Office365Users.UserPhotoV2(ThisItem.'Requested By'.Email), ""),
    SampleImage
    ),
    SampleImage
    )
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @JimmyWork  
    THANK YOU SO SO SO SO  MUCH YOU saved my life

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    hi  @RusselThomas  

    thank you for your efforts to help, i tried the solution of  @JimmyWork  and it works now

    thank you again 

  • RusselThomas Profile Picture
    4,014 on at

    Awesome, glad to hear it!

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