Forum Discussion
format group headers to remove column name for a look up column
I need to remove the column name from the header in my SharePoint library, however the JSON I usually use is not working because the grouped column is a lookup column. When I use my usual JSON, the column header shows [object Object].
I found the following JSON which shows the column name, but still has the column header and file count:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "a",
"txtContent": "@currentField",
"attributes": {
"target": "_blank",
"href": "=if(indexOf([$ContentTypeId], '0x0120') >= 0, '?id=' + [$FileRef], @currentWeb + '/_layouts/15/Doc.aspx?sourcedoc='+ [$UniqueId] + '&action=View')"
}
}
Can someone help me to adjust this JSON to show only the column name (no header and no file count)?
1 Reply
Hello tlangfor
have you checked this example? https://github.com/pnp/List-Formatting/tree/master/view-samples/group-header-remove-column-name
Regards, Dave