cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Helper II
Helper II

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
Highlighted
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.
Highlighted
Helper II
Helper II

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 ?

 

 

Highlighted
Helper II
Helper II

Re: UserPhoto and UserPhotoV2 error

@v-xida-msft 

Any thoughts ?

Highlighted
Helper II
Helper II

Re: UserPhoto and UserPhotoV2 error

@yashag2255

Any Thoughts?

Highlighted
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!
Highlighted
Community Support
Community Support

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.
Highlighted
Helper II
Helper II

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'

Highlighted
Helper II
Helper II

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'

Highlighted
Helper II
Helper II

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (7,455)