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

Office365Users.UserPhotoV2 returning error (The method UserPhotoV2 invalid parameter for 'userid'

Hey there all!


First post here, coming in with an issue I cannot seem to make any sense of. I am trying to display a users profile picture next to the gallery item associated with that user, and while the code successfully works, it always returns with the error "The method X (UserPhoto or UserPhotoMetadata) has an invalid parameter for 'userid' 

 

My Code:

If(Office365Users.UserPhotoMetadata(Office365Users.UserProfileV2(Staff.Email).id).HasPhoto, Office365Users.UserPhotoV2(Staff.Email), SampleImage)

 

I have tried isolating just the UserPhotoV2 and have the same result, the only way to get rid of the error is to hard code the email rather than using a variable. Any suggestions? 

4 REPLIES 4
h-nagao
Level 10

Re: Office365Users.UserPhotoV2 returning error (The method UserPhotoV2 invalid parameter for 'userid

Hello,

I have posted blog explaining how-to fix it.
Wishing this would help you :-)

https://powerusers.microsoft.com/t5/PowerApps-Community-Blog/Display-User-Photo-in-Gallery-on-All-de...
RFMDias
Level: Powered On

Re: Office365Users.UserPhotoV2 returning error (The method UserPhotoV2 invalid parameter for 'userid

Hi!

I am struggling with adding user photo as you have described, my code:

If(
!IsBlank(ThisItem.AssignedTo.Email),
Office365Users.UserPhotoV2(ThisItem.AssignedTo.Email)
)

The "AssignedTo" is from a Task List I am using as Data Source for my PowerApp. It is a "Person" feild.

I get an error message in the formula bar: "Invalid argument type (Table). Expecting a Text value instead."

Have you come across this type of error?

Thanks

Highlighted
h-nagao
Level 10

Re: Office365Users.UserPhotoV2 returning error (The method UserPhotoV2 invalid parameter for 'userid

Hi RFMDias,

Can you try First(ThisItem.AssignTo).Email ?
I think AssignTo field is allowed to contain multiple person. So, ThisItem.AssignTo.Email become Table to email of Assigned people.

Thanks,
Hiro
RFMDias
Level: Powered On

Re: Office365Users.UserPhotoV2 returning error (The method UserPhotoV2 invalid parameter for 'userid

It worked! Smiley Happy

Thank you very much!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 55 members 4,627 guests
Please welcome our newest community members: