0

I have a SharePoint list with a Person column and the list has 3 views. For the 3rd view I want only the picture shown and not the name of the person.

How can I do that?

2 Answers 2

1

You can show only user image and hide user name using SharePoint JSON column formatting.

However, when you apply JSON column formatting to any column, it will change the display of column from All list views, not only specific SharePoint list view (if this is what you want - For the 3rd view I want only the picture shown and not the name of the person).

You can find the related JSON samples in PnP List formatting samples Github repository:

  1. Display a Person's Profile Picture in a Circle - single selection person or group column

    enter image description here

  2. Multi-Person Facepile - multiple selections person or group column

    enter image description here


If you want to show user image and hide user name for only one list view and keep both image and name of users for all other list views, you will have to format the 3rd list view from scratch and build custom list view using JSON. Note, it will remove all SharePoint OOTB functionalities (filtering/sorting/context menu, etc.).

Related links:

  1. Change column name in view using json view formatting
  2. SharePoint Modern List - Change fill color of column headers
  3. Custom Header & List view - view formatting sample
0

There is sample code for a round person image in Github.

https://github.com/pnp/List-Formatting/tree/master/column-samples/person-roundimage-format

You can change the JSON settings to another shape if needed.

This sample applies styles to a parent div element and a child img element to show a person's profile picture in a circle.

The size can be easily adjusted by changing the default value of 32px for both the width and height style attributes on the parent div.

You can also adjust the border-radius value of the parent div to change it from a full circle (50%) to a rounded rectangle (< 50%). To get larger profile pictures you can change the size=S portion of the URL to use either size=M or size=L. See the table below for details on image size.

For best results, images should be square (S & M user profile pictures always are).

enter image description here

1
  • If that resolved your issue, please mark the answer as described in the tour. If it didn't, please leave a comment, so I can follow up.
    – teylyn
    Commented Jun 23 at 21:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.