May 05 2020 07:56 AM
Dears,
Kindly help me with the JSON code so that the color of rows in Name column is red.
I have achieved similarly in the Folder Child Count, however I am unable to do in Name column.
I want the Name column to be red of the value of Folder Child Count is 0.
May 05 2020 10:27 AM
Solution@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', '')"
}
}
May 05 2020 10:27 AM
Solution@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', '')"
}
}