Forum Discussion

RobOK's avatar
RobOK
Bronze Contributor
Sep 04, 2020

Lists - Person Column with profile face and name together

How do you format a List column to have both an icon and a name? Is there sample JSON to do this? Does it require two columns?

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    RobOK if it's just a single line of text column you can do this with the following JSON:

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
      "elmType": "div",
      "attributes": {
        "class": "sp-field-severity--good"
      },
      "children": [
        {
          "elmType": "span",
          "style": {
            "display": "inline-block",
            "padding": "12px 4px"
          },
          "attributes": {
            "iconName": "Emoji2"
          }
        },
        {
          "elmType": "span",
          "txtContent": "@currentField"
        }
      ]
    }

     

    which gives the following result (in the StaffMember column):

     

    If you have a Person column type then things get more complicated and I'll need to investigate what the JSON for that would be.

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User.
    If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

    • RobOK's avatar
      RobOK
      Bronze Contributor

      RobElliott 

       

      Thanks for fast reply! Sorry my original wording probably threw you off... i meant the small face circle from someone's O365 profile (i used the word icon, but i guess maybe it is avatar?). [I edited the post title to be more clear]

       

      So I am thinking a Person column, not text, which i think is complicated.

       

      In some of the previews they have face and name if it is one person, and if it is multiple people just the row of faces. That might be in Planner List view that I saw that. That would be more advanced obviously. 

  • I know that this comes 3 years late, RobOK, but I think that I have maybe found one that can lead you to something resembling a single column experience in the gallery.

     

    Check out TetsuyaKawahara1107 / TetsuyaKawahara120 's really pretty Praise Cards.

     

    I am currently trying to figure out how to plonk some semblence of that into my list ... but it ain't easy, I tell ya!

Resources