Lists - Person Column with profile face and name together

%3CLINGO-SUB%20id%3D%22lingo-sub-1635684%22%20slang%3D%22en-US%22%3ELists%20-%20Column%20with%20face%20icon%20and%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1635684%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20do%20you%20format%20a%20List%20column%20to%20have%20both%20an%20icon%20and%20a%20name%3F%20Is%20there%20sample%20JSON%20to%20do%20this%3F%20Does%20it%20require%20two%20columns%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1635684%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1636004%22%20slang%3D%22en-US%22%3ERe%3A%20Lists%20-%20Column%20with%20face%20icon%20and%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1636004%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3786%22%20target%3D%22_blank%22%3E%40Rob%20O'Keefe%3C%2FA%3E%26nbsp%3Bif%20it's%20just%20a%20single%20line%20of%20text%20column%20you%20can%20do%20this%20with%20the%20following%20JSON%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-json%22%3E%3CCODE%3E%7B%0A%20%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fcolumn-formatting.schema.json%22%2C%0A%20%20%22elmType%22%3A%20%22div%22%2C%0A%20%20%22attributes%22%3A%20%7B%0A%20%20%20%20%22class%22%3A%20%22sp-field-severity--good%22%0A%20%20%7D%2C%0A%20%20%22children%22%3A%20%5B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22elmType%22%3A%20%22span%22%2C%0A%20%20%20%20%20%20%22style%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22display%22%3A%20%22inline-block%22%2C%0A%20%20%20%20%20%20%20%20%22padding%22%3A%20%2212px%204px%22%0A%20%20%20%20%20%20%7D%2C%0A%20%20%20%20%20%20%22attributes%22%3A%20%7B%0A%20%20%20%20%20%20%20%20%22iconName%22%3A%20%22Emoji2%22%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%2C%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%22elmType%22%3A%20%22span%22%2C%0A%20%20%20%20%20%20%22txtContent%22%3A%20%22%40currentField%22%0A%20%20%20%20%7D%0A%20%20%5D%0A%7D%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ewhich%20gives%20the%20following%20result%20(in%20the%20StaffMember%20column)%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22iconPlusText.png%22%20style%3D%22width%3A%20383px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F216614i7C374E79A56BFB2A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22iconPlusText.png%22%20alt%3D%22iconPlusText.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20a%20Person%20column%20type%20then%20things%20get%20more%20complicated%20and%20I'll%20need%20to%20investigate%20what%20the%20JSON%20for%20that%20would%20be.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3ERob%3CBR%20%2F%3ELos%20Gallardos%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%20color%3D%22%23006400%22%3EMicrosoft%20Power%20Automate%20Community%20Super%20User.%3CBR%20%2F%3EIf%20I've%20answered%20your%20question%20or%20solved%20your%20problem%2C%20please%20mark%20this%20question%20as%20answered.%20This%20helps%20others%20who%20have%20the%20same%20question%20find%20a%20solution%20quickly%20via%20the%20forum%20search.%20If%20you%20liked%20my%20response%2C%20please%20consider%20giving%20it%20a%20thumbs%20up.%20Thanks.%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1636021%22%20slang%3D%22en-US%22%3ERe%3A%20Lists%20-%20Column%20with%20face%20icon%20and%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1636021%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F174092%22%20target%3D%22_blank%22%3E%40Rob%20Elliott%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20fast%20reply!%20Sorry%20my%20original%20wording%20probably%20threw%20you%20off...%20i%20meant%20the%20small%20face%20circle%20from%20someone's%20O365%20profile%20(i%20used%20the%20word%20icon%2C%20but%20i%20guess%20maybe%20it%20is%20avatar%3F).%20%5BI%20edited%20the%20post%20title%20to%20be%20more%20clear%5D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20I%20am%20thinking%20a%20Person%20column%2C%20not%20text%2C%20which%20i%20think%20is%20complicated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20some%20of%20the%20previews%20they%20have%20face%20and%20name%20if%20it%20is%20one%20person%2C%20and%20if%20it%20is%20multiple%20people%20just%20the%20row%20of%20faces.%20That%20might%20be%20in%20Planner%20List%20view%20that%20I%20saw%20that.%20That%20would%20be%20more%20advanced%20obviously.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1636452%22%20slang%3D%22en-US%22%3ERe%3A%20Lists%20-%20Column%20with%20face%20icon%20and%20name%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1636452%22%20slang%3D%22en-US%22%3EYou%20can%20find%20best%20list%20formatting%20samples%20here%3A%3CBR%20%2F%3E-%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fpnp%2Fsp-dev-list-formatting%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fpnp%2Fsp-dev-list-formatting%3C%2FA%3E%3CBR%20%2F%3E-%20%3CA%20href%3D%22https%3A%2F%2Fpnp.github.io%2Fsp-dev-list-formatting%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fpnp.github.io%2Fsp-dev-list-formatting%2F%3C%2FA%3E%3C%2FLINGO-BODY%3E
Super Contributor

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?

4 Replies

@Rob O'Keefe 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):

iconPlusText.png

 

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.

@Rob Elliott 

 

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. 

@Juan Carlos González Martín Thanks! I have been through those and found one to show the profile image but not BOTH the profile image and name togetehr in one column. 

 

This page is where i found the profile image:

https://pnp.github.io/sp-dev-list-formatting/groupings/columntype/