web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / "Office365UserPhoto Us...
Power Apps
Unanswered

"Office365UserPhoto UserPhoto method has an invalid value for the userId parameter."

(0) ShareShare
ReportReport
Posted on by

Good afternoon,

I made an App in Power Apps that searches by name and surname the employees of my company and shows in a gallery the matches.
When the user uses the application in its Web version there is no problem, but when accessing the mobile version gives the following error message when loading the search:

"Office365UserPhoto UserPhoto method has an invalid value for the userId parameter."

It shows the error but loads the images well.
I understand that if I put some timing when loading the screen it will be solved.
Do you know the way to put the timing on the screen so that it waits some seconds when entering?
How could I hide the error so that it is not shown even if it fails, since the operation even if it takes a little while is correct?

Thank you very much

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Anonymous use the IfError function to catch the error. 

  • Community Power Platform Member Profile Picture
    on at

    First of all, thank you very much for your time.

    I am trying to capture the error this way:

    IfError(
    Office365Users.UserPhoto(First(myProfile).profile.Id);"")

    but it keeps showing me the same error in the mobile version.

    Best regards

  • Verified answer
    v-albai-msft Profile Picture
    on at

    Hi @Anonymous ,

    I used to meet this error, finally I add a condition to check if ThisItem.Email is blank before getting photo, and this works well. 

    So I would suggest you try this formula, check if this can solve your issue(persondefault1 is a Person column inside my list):

     

    If(
     !IsBlank(ThisItem.XXX.Email),
     If(
     Office365Users.UserPhotoMetadata(ThisItem.XXX.Email).HasPhoto = true,
     Office365Users.UserPhotoV2(ThisItem.XXX.Email)
    ))

     

     

    v-albai-msft_0-1620958066098.png

    Best regards,

    Allen

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-albai-msft ,

    Thank you very much, I managed to solve it thanks to your input, in the end it looks like this.

    If(IsBlank(ThisItem.Mail)=false && Office365Users.UserPhotoMetadata(ThisItem.Mail).HasPhoto;Office365Users.UserPhoto(ThisItem.Mail))

    Best regards

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard