cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NamegomJan
Helper II
Helper II

Adding a dynamic profile picture in a Gallery

Hi everyone,

 

I have a Gallery with a Sharepoint list as a source and want to show the profile picture of the user in that Gallery item that is mentioned in the list.

 

The formula: Office365User.UserPhoto("name.name@email.com") will show me a picture. But if I want to retrieve that email dynamically it wont work. This is the formula: Office365User.UserPhoto(Thisitem.Titel). In the field "Titel" the respective email is mentioned.

 

By the way I am using the german version so my formula is:

 

'Office365-Benutzer'.UserPhoto(ThisItem.Titel)

 

I have also a second field which is called "SendTo" where also a email address is mentioned. However this also does not work.

 

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @NamegomJan ,

You can User Like below if you are using dynamics EMail ID.

Office365Users.UserPhotoV2(Text(User().Email)).

Thanks,
Vijay

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."-Vijay

View solution in original post

10 REPLIES 10
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @NamegomJan ,

You can User Like below if you are using dynamics EMail ID.

Office365Users.UserPhotoV2(Text(User().Email)).

Thanks,
Vijay

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."-Vijay

Thanks. But this will show me the picture of the User using the app right? I don't want this. I want to retrieve a specific email address from a sharepoint list and show the picture of that user.

Hi @NamegomJan ,

Yes You can use like your Requirment.

ThiItem.TItle or whatever you want to pass.

Thanks,

Hi Vijay,

 

thanks. But unfortunately this does not work. I used this formula:

 

'Office365-Benutzer'.UserPhotoV2(Text(ThisItem.Titel)). It shows nothing. 

 

Thanks

Hi @NamegomJan ,

Its working perfectly Fine for me - 
see the below - 

Office365Users.UserPhotoV2(Text(ThisItem.Title))

VijayTailor_0-1603641804916.png

See the list reference for me - 

VijayTailor_1-1603641886198.png

Thanks,
Vijay

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."-Vijay

Hi Vijay,

 

thank you so much. It works. The problem was that the test user has no profile picture.

 

Is there a possibility to add the standard picture for those cases? And if I have no email address in that list but only the name of the user, is there still a possibility to get the profile picture?

 

Thanks!!

Hi @NamegomJan ,

In this case, you can Upload one user image in Media and DIsplay in the condition when users don't have a profile pic then you can display that one.
Code for Condition - 

If(IsBlank(Text(Office365Users.UserPhotoV2(Text(ThisItem.Title)))),Office365Users.UserPhotoV2(Text(ThisItem.Title)),vvv)


see the Demo -
User365ProfilePicBlank.gif

Thanks,
Vijay

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."-Vijay



Awesome great. It works. I encounter one more problem:

 

Office365Users.UserPhotoV2(Text(ThisItem.Title))

 

If Title is a name. Can I transform it somehow to the corresponding email address? Or is there another workaround to get the profile picture just from the name?

 

Thanks!

 

Hi @NamegomJan ,

YOu can use the below COde for this Purpose and implement the logic for retrieve email based on displayName.

below code use for this Purpose - 

If(IsMatch(Text(ThisItem.Title), Match.Email), ThisItem.Title, "No EMail - here impliment the logic for retive email ID") //ThisItem.Title

Thanks,

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."-Vijay

 

Helpful resources

Announcements
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.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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