cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frederik_Rier
Helper I
Helper I

Office365Users: Get other Peoples Active Directory Profilpicture

Hello everybody,

 

I have a list of people who have profile pictures within our Active Directory.

 

I have connected the Connector: Office365Users to let the profile pictures of the people appear next to the corresponding names.

My current formula looks like this:

Office365Users.UserPhotoV2(Label_Employee_Email.Text)

 

I've attached a screenshot for your convenience 

EmployeeSearch2.png

Best Regards

Frederik Rier

2 ACCEPTED SOLUTIONS

Accepted Solutions

@Frederik_Rier 

UserPhotoV2 will get the picture of any Office 365 user, not just yours.

 

Using this code in the Image property will tell you if they have a photo or not.  If no picture is found the placeholder image called SampleImage will be displayed.

If(
    Office365Users.UserPhotoMetadata(User().Email).HasPhoto=false,
    SampleImage,
    Office365Users.UserPhotoV2(User().Email)
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@Frederik_Rier 

Change the two instances of User().Email to ThisItem.EmailColumnName.

If(
    Office365Users.UserPhotoMetadata(ThisItem.EmailColumnName).HasPhoto=false,
    SampleImage,
    Office365Users.UserPhotoV2(ThisItem.EmailColumnName)
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

11 REPLIES 11
mdevaney
Super User
Super User

@Frederik_Rier
What is your question? I don’t see any question in your original post.
ilton
Resolver II
Resolver II

Hi! @Frederik_Rier 

try 

If(Office365Users.UserPhotoMetadata("user@mail.com").HasPhoto,  Office365Users.UserPhotoV2("user@mail.com"), SomeDefaultImage)

Hi @mdevaney,

 

My question is:

How do I get the profile pictures that my teammates have in Active Directory in the Gallery as profile pictures?

So that I can scroll through the Gallery afterwards and see my teammates listed, with corresponding pictures as "profile pictures"

With Office365Users.UserPhotoV2 (User (). Email) I get my photo but how do I get it from my teammates?

 

I have the email address of every colleague in the gallery in the label "Label_Empoyee_Email"

 

I appreciate any help;)

Best wishes


Frederik Rier

Hi!

the method Office365Users.UserPhotoV2 gets profile picture from any user

 

using he if will tell you if user has image

@Frederik_Rier 

UserPhotoV2 will get the picture of any Office 365 user, not just yours.

 

Using this code in the Image property will tell you if they have a photo or not.  If no picture is found the placeholder image called SampleImage will be displayed.

If(
    Office365Users.UserPhotoMetadata(User().Email).HasPhoto=false,
    SampleImage,
    Office365Users.UserPhotoV2(User().Email)
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Hello mdevaney, unfortunately the formula doesn't work for me. Do I have to change anything there?

First Try:

If(
    Office365Users.UserPhotoMetadata(User().Email).HasPhoto=false,
    SampleImage,
    Office365Users.UserPhotoV2(User().Email)
)

Second Try: 

I thought that "Label_Employee_Email" includes the value of the email address so that the corresponding user (and his profile picture) can then be found.

 

Best Regards

Frederik Rier

Hi! @Frederik_Rier can you share the error message or result

Hi @ilton

 

it worked now. But i got only Sample Images.

 

In Microsoft Teams and in Exchange anyone has there Default Profilpicture. Do you know, why PowerApps didnt get access to this pictures ? 

 

EmployeeSearch3.png

 

Many Thanks 

Frederik Rier

Hi!

you are using your email for all cases.

try using the email text label

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,689)