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)
Solved! Go to Solution.
If(!IsBlank(ThisItem.About_Resource),Office365Users.UserPhoto(ThisItem.About_Resource))
Tried this and this works
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.
'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 ?
@Anonymous
Hi @Anonymous ,
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:
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,
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
User | Count |
---|---|
257 | |
110 | |
97 | |
52 | |
39 |