Question

I have been referring to:

Use column formatting to customize SharePoint

And also reading multiple blog posts around the subject.

I have not yet found a definitive list of object properties available through column formatting.

I looked around the SharePoint REST API v1 docs, but there doesn't seem to be any complete reference there (and I'm not sure if what is available via the API is also available through column formatting).

Does a resource like this exist?

I am specifically trying to find what properties are accessible in a Person object.

I want to show the username in a column, based of an existing Person column.

I have had success implementing this basic formatting:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "[$Person.title]"
}

And this has also worked for: [$Person.email], [$Person.id].

But I cannot see how to access username and workemail, etc.

Was it helpful?

Solution

Using column formatting on Person or Group type field you can only access below properties as of now (with example values):

{
   "id": "122",
   "title": "Kalya Tucker",
   "email": "kaylat@contoso.com",
   "sip": "kaylat@contoso.com",
   "picture": "https://contoso.sharepoint.com/kaylat_contoso_com_MThumb.jpg?t=63576928822",
   "department":"Human Resources",
   "jobTitle":"HR Manager"
}

Official documentation:

Column Formatting in SharePoint - Special string values - Check People fields section

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top