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

UserPhotoMetaData UserID Error

Hey guys,

 

Sorry, I know that there are many discussion opened about this matter but I didn't understand if there is a solution or if Microsoft team is working on it.

I have tried many ways to avoid the error but without success. What is funny is that the code is working, but with this annoying error message.

 

Code

If(Office365Users.UserPhotoMetadata(sharepointID).HasPhoto=true,Office365Users.UserPhotoV2(sharepointID),SampleImage)

Error:

Office365Users.UserPhotoMetadata failed: The method 'UserPhotoMetadata' has an invalid value for parameter 'userId'

IMG_B0545BE8702B-2.jpeg

20 REPLIES 20

I have tried but unfortunately I still getting the error.

It is so frustrating because it is working but showing this error. I can't publish this version with this error being showing to the users.

 

Thank you so much for your support and time.

@wagnerfraga 

 

There is one more thing I would suggest you to try out. Try exporting the app in the current state and import it as a new app and then try it out. It might work that way!

 

Hope this Helps!

It is so frustrating, I have tried what you have suggested but no success. 😕

 

Untitled-1.jpg

Hey @wagnerfraga It is frustrating but can we give it another try? 

 

Expression: If(!IsBlank(ThisItem.Email),If(Office365Users.UserPhotoMetadata(ThisItem.Email).HasPhoto=true,Office365Users.UserPhotoV2(ThisItem.Email),SampleImage))
 
Please try to use this one. 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.
 
 
Hope this Helps!
 

Thank you for dedication and persistence!

You are THE guy!

 

Not it is working perfectly and withou this %$# error message.

 

Many Many Many thanks,

Wagner

@wagnerfraga  Glad that it Worked!!

powerappissue.png

I am still getting a similar error with the following formula:

 

If(!IsBlank(ThisItem.Mail),
If(Microsoft365Users.UserPhotoMetadata(ThisItem.Mail).HasPhoto=true,
Microsoft365Users.UserPhoto(ThisItem.Mail)))

 

Any ideas? I feel like I have tried everything. No errors appear in the app checker, and it can be published, and it works fine, but it keeps throwing this error.

PowerP_Lover
Frequent Visitor

There have to be a null checker:

 

If(Office365Users.UserPhotoMetadata(If(IsBlank(ThisItem.Id), "SampleID" , ThisItem.Id)) ...

 

Instead of SampleID you can write: User().Email

Muni
Microsoft
Microsoft

I am also getting the same issue, tried multiple solutions suggested. But not fixed.

mgudites
Helper I
Helper I

I am also still getting this error, and none of the code snippets I've tried have worked. 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,878)