cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AhTarek
Frequent Visitor

Office 365 Users Photos Error - Invalid value for Parameter 'userId'

I have sharepoint list connected to gallery, the list has person field "Email" and text field with email addresses "EmailText" and field with thier PrincipalName named it "UserID" of some of the users that I want to display thier info on this gallery including thier Photo, I used the below formula but i get this error when I test the app on my iPad (tested on differents devices I get the same error)

CrestorError.jpg

Function used:

 

If(IsBlank(Office365Users.UserPhoto(ThisItem.Email.Email)),'genirc pp',Office365Users.UserPhoto(ThisItem.Email.Email))

I also tried different parametes for userphotos like Office365Users.UserPhoto(ThisItem.UserID) OR Office365Users.UserPhoto(ThisItem.TextEmail)

 

I also tried this (with different parametes )

If(Office365Users.UserProfile(ThisItem.UserID).AccountEnabled=false,'genirc pp',Office365Users.UserProfile(ThisItem.UserID).AccountEnabled = true And Office365Users.UserPhotoMetadata(ThisItem.UserID).HasPhoto= false,'genirc pp',Office365Users.UserPhoto(ThisItem.UserID))

but this time i get to invalid errors on both Userprofile and Userphotos

 

I also tried to use collection instead of sharepoint list and in this collections I retrived userId data from the funcion Office365User.SearchUser for each email address and used it as parameter but it game me error on the editor itself as invild parameter and excpecting text value instead (I tried converting it to text but it didn't work either)

 

however the function is working normaly and it shows the images as I wanted to be, but this red error it appears only once when I open the page where includes the gallary, so anyone colud help me with this error?

 

13 REPLIES 13

Office(365.UserPhotoV2(ThisItem.Email) is what finally worked for me.

Thats awesome! thanks for sharing

all of these functions are working perfectly with me but i still gets RunTime error on iPad and Android devices that I have mentioned in my orginal post

AhTarek
Frequent Visitor

I am facing the same error in different apps using (Office365) functions although it's working fine, Is there any way to report this as bug or something in (Office365) API ?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,791)