cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
gazzo1967
Impactful Individual
Impactful Individual

Displaying people picker Image. Formula Help needed

Hi All
hope you are all safe 🙂
I have have this formula on an image which populates from the people picker in a form.

If(Office365Users.UserPhotoMetadata(DataCardValue2.Selected.Email).HasPhoto=false,SampleImage,Office365Users.UserPhoto(DataCardValue2.Selected.Email))

 

Unfortunately it returns a runtime error even though it does work.
This is shown as an error message to the user
Thanks 
Gary

1 ACCEPTED SOLUTION

Accepted Solutions
gazzo1967
Impactful Individual
Impactful Individual

Its ok i worked out my mistake!!
For others the solution is
If(IsBlank(DataCardValue2.Selected.Email),SampleImage,Office365Users.UserPhotoV2(DataCardValue2.Selected.Email))

View solution in original post

2 REPLIES 2
gazzo1967
Impactful Individual
Impactful Individual

awww come on you fantastic solvers it must be a simple thing I'm missing 😞
I know its easy to do if its the logged in user but I'm not after the logged in person but the person being selected in the people picker.
And i know I'm using the email instead of the userid.
Error for user logged in

gazzo1967_0-1646776199807.png

Thanks in Advance 🙂
Gary

gazzo1967
Impactful Individual
Impactful Individual

Its ok i worked out my mistake!!
For others the solution is
If(IsBlank(DataCardValue2.Selected.Email),SampleImage,Office365Users.UserPhotoV2(DataCardValue2.Selected.Email))

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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