Forum Discussion
JSON code to change color of Name of Folder in Sharepoint Online
- May 05, 2020
cyberco20 What have you tried so far? You should be able to apply a very similar column formatting rule to your Name column, except you will want to reference the FolderChildCount column.
To reference that column, you would use the following syntax [$ColumnName]. So in this example, you would use [$FolderChildCount]
An example would be something like this:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"attributes": {
"class": "=if([$FolderChildCount] != '0','sp-field-severity--severeWarning', '')"
}
}
cyberco20 What have you tried so far? You should be able to apply a very similar column formatting rule to your Name column, except you will want to reference the FolderChildCount column.
To reference that column, you would use the following syntax [$ColumnName]. So in this example, you would use [$FolderChildCount]
An example would be something like this:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"attributes": {
"class": "=if([$FolderChildCount] != '0','sp-field-severity--severeWarning', '')"
}
}