cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SoB
Level: Powered On

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
SoB
Level: Powered On

Re: UserPhoto and UserPhotoV2 error

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

 

Tried this and this works

View solution in original post

11 REPLIES 11
Dual Super User
Dual Super User

Re: UserPhoto and UserPhotoV2 error

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.
SoB
Level: Powered On

Re: UserPhoto and UserPhotoV2 error

'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 ?

 

 

SoB
Level: Powered On

Re: UserPhoto and UserPhotoV2 error

@v-xida-msft 

Any thoughts ?

SoB
Level: Powered On

Re: UserPhoto and UserPhotoV2 error

@yashag2255

Any Thoughts?

Dual Super User
Dual Super User

Re: UserPhoto and UserPhotoV2 error

@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 Team
Community Support Team

Re: UserPhoto and UserPhotoV2 error

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.
SoB
Level: Powered On

Re: UserPhoto and UserPhotoV2 error

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'

SoB
Level: Powered On

Re: UserPhoto and UserPhotoV2 error

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'

SoB
Level: Powered On

Re: UserPhoto and UserPhotoV2 error

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

 

Tried this and this works

View solution in original post

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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