Forum Discussion

delluser120's avatar
delluser120
Copper Contributor
Jul 08, 2022

JSON formatting font color of Person or Group column

I'm trying to use JSON formatting to change the font color of a person or group column in sharepoint. I use the following json formatting for choice, date and time, and single line of text columns, which works great:

{  
  "elmType": "div",  
  "txtContent": "@currentField",  
  "style": {  
    "color":  "#000000",  
    "padding-left": "14px"
  }
}


Whenever I use the same formatting on my person or group columns, I get a display of "[object Object]" rather than the field's value in my choice of font color. In my screenshot below, the Modified field (date and time) uses the same JSON as the Modified By field (person or group) and works perfectly.

 

Does anyone have any ideas on how to get around this? Thanks so much in advance!!

1 Reply

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    delluser120 use @currentField.title

    {  
      "elmType": "div",  
      "txtContent": "@currentField.title",  
      "style": {  
        "color":  "#006666",  
        "padding-left": "14px"
      }
    }

     

    Rob
    Los Gallardos
    Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

Resources