cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

UserPhoto and UserPhotoV2 error

Office365Users.UserPhotoV2 failed: The method 'UserPhotoV2' has an invalid value for parameter 'id'

 

Office365Users.UserPhotoV2 failed: The method 'UserPhoto' has an invalid value for parameter 'id'

 

Getting this error everytime during Runtime.

 

I am able to view the profile photos of otherusers but still get this error.

 

My Code:

Office365Users.UserPhotoV2(ThisItem.About_Resource)

 

1 ACCEPTED SOLUTION

Accepted Solutions

If(!IsBlank(ThisItem.About_Resource),Office365Users.UserPhoto(ThisItem.About_Resource))

 

Tried this and this works

View solution in original post

12 REPLIES 12
Dual Super User III
Dual Super User III

Are you verifying that ThisItem.About_Resource contains a valid UPN?  Also double check that the user actually has a profile picture.  I've seen this kind of error message if the profile picture doesn't exist or hasn't populated through the system yet.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

'About_Resource' is the coloumn name under which all the email ids are written.

 

Want to display the list of all the resources-  Their Profile Pic, Display Name and Email Id

 

Profile Pic: Office365Users.UserPhotoV2(ThisItem.About_Resource)

Display Name : Office365Users.UserProfileV2(About_Resource).displayName

Email: ThisItem.About_Resource

 

Profile pic is dispalyed for people whose profile images are displayed on both Outlook and Skype for Business.

Profile pic is NOT displayed for people who have profile image only on Outlook and Not on Skype for Business.

There may be some other reason.

 

But getiing this error on the page header:

Office365Users.UserPhotoV2 failed: The method 'UserPhotoV2' has an invalid value for parameter 'id'

 

Can this error message be removed ?

 

 

@v-xida-msft 

Any thoughts ?

@yashag2255

Any Thoughts?

Dual Super User II
Dual Super User II

@SoB 

 

Can you try to use below expression:

If(!IsBlank(ThisItem.About_Resource),If(Office365Users.UserPhotoMetadata(ThisItem.About_Resource).HasPhoto=true,Office365Users.UserPhotoV2(ThisItem.About_Resource))
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Community Support
Community Support

Hi @SoB ,

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:2.JPG

Set the Image property of the Image control to following:

Office365Users.UserPhoto(User().Email)

On your side, please consider modify your formula as below:

If(
   IsBlank(ThisItem.About_Resource),
   SampleImage,
   Office365Users.UserPhoto(ThisItem.About_Resource)
)

Or

If(
   Office365Users.UserPhotoMetadata(ThisItem.About_Resource).HasPhoto = true,
Office365Users.UserPhoto(ThisItem.About_Resource),
SampleImage )

Please consider take a try with above solution, then check if the issue is solved.

 

If the issue still exists, please consider re-create a new connction to your Office 365 Users conector from your app, then try above solution again, check if the issue is fixed.

 

Also please make sure the emails entered within your data source is valid.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @yashag2255 ,

 

This now shows the sample image for the people who do not have profile pic but shows the below error:

 

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

Hi @v-xida-msft  ,

 

This now shows the sample image for the people who do not have profile pic but shows the below error:

 

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

If(!IsBlank(ThisItem.About_Resource),Office365Users.UserPhoto(ThisItem.About_Resource))

 

Tried this and this works

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,807)