Forum Discussion
Unable to format document library Title field with JSON
- Mar 25, 2019
Hello tiredoldcoder ,
I don't believe the Name/Title column is supported.
From Use column formatting to customize SharePoint:
Supported column types
The following column types support column formatting:
- Single line of text
- Number
- Choice
- Person or Group
- Yes/No
- Hyperlink
- Picture
- Date/Time
- Lookup
- Title (in Lists)
The following are not currently supported:
- Managed Metadata
- Filename (in Document Libraries)
- Calculated
- Retention Label
- Currency
I hope this helps.
Norm
Hello tiredoldcoder ,
I don't believe the Name/Title column is supported.
From Use column formatting to customize SharePoint:
Supported column types
The following column types support column formatting:
- Single line of text
- Number
- Choice
- Person or Group
- Yes/No
- Hyperlink
- Picture
- Date/Time
- Lookup
- Title (in Lists)
The following are not currently supported:
- Managed Metadata
- Filename (in Document Libraries)
- Calculated
- Retention Label
- Currency
I hope this helps.
Norm
- tiredoldcoderMar 26, 2019Copper Contributor
For the sake of closing the loop, my work-around was to create another field and use JSON formatting to populate it (vice use a calculation field, though I assume that would have worked too). Of note, the pseudo column cannot be blank or null - I just defaulted it to be "*". The below JSON makes all my "Final" documents display in bold text, everything else is indented to set them apart.
{
"elmType": "div",
"txtContent": "=[$Title]",
"attributes": {},
"style": {
"font-weight": "=if([$IsFinal], 'bold', '')",
"padding-left": "=if([$IsFinal], '0em', '2em')"
},
"customRowAction": {},
"children": []
}Thanks to all for your input!