Pnp-modern-search: Profile image for employee directory

Created on 24 Jun 2021  路  4Comments  路  Source: microsoft-search/pnp-modern-search

Version used
4.2.3

Question
I am trying to leverage PnP Modern Search to build an employee directory (cf. related twitter thread involving in particular @wobba and @sympmarc).

Configuration:
SharePoint Search (no Graph API access granted)
Results source: LocalPeopleResults
Layout: People

This is working pretty well, except that the profile pictures are not showing up for some users (screenshot below). What am I missing here?

Thanks!

Screenshots
image

question

All 4 comments

If you hit F12 and look at:

  • Network calls which fails for image
  • Inspect the DOM for the URL which is being used

We are using this URL:
/_layouts/15/userphoto.aspx?size=L&username=<username/upn>

Right, and I actually found the URL in the handlebars expression under the results Web Part Property Pane.

I assume the pictures for my test users Miriam and Megan don't show up because they never visited SharePoint. They used Teams and the SharePoint API but apparently that's not enough.

Would you have another method to recommend - using the Property Pane settings - to get the profile pictures?

That's the only URL I know which is within the SP domain not needing extra auth to be called.

@wobba ok, thanks for the help. I'll continue working on my employee directory customization, let's keep in touch!

Was this page helpful?
0 / 5 - 0 ratings