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

Conditions with UserPhotov2

Hello,

 

I'm new to PowerApps but am trying to learn the platform.  I am building a Employee Search App and have most of the app working, but am now trying to add the eomployee photo when each employee is selected.  I have been search this community and others, but have not been able to find a solution that works yet.

 

When I use Office365Users.UserPhotoV2(First(Employee).Id) it pulls the photo and everything works.  However when I run the app, I get an error: Office365Users.UserPhoto failed: The method 'UserPhoto' has an invalid value for parameter 'userId'

 

I was thinking if I use an if statement, that may help.  I'm trying something like this:  If(Office365Users.UserPhotoV2(First(Employee).Id).HasPhoto=false,SampleImage,Office365Users.UserPhotoV2(First(Employee).Id) . However I get the attached formula errors.

 

If anyone can provide asssistance, I would greatly appreciate the help.

2 REPLIES 2
Frequent Visitor

This doesnt throw errors when launched from a computer, but does from a mobile device.  It also do not generate any errors in Studio.

 

If(!Office365Users.UserPhotoV2(First(Employee).Id),Office365Users.UserPhotoV2(First(Employee).Id),SampleImage)

Hi, I'm seeing the same errors with an app I've created and when I try to solely use the template 'People' screen.  Have you rasied a support ticket?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,965)