Forum Discussion
Chris Cundy
May 27, 2020Copper Contributor
Conditionally change color based on number value of another column
Hello, I have two number columns - "Staff" and "Capacity". I would like the "Capacity" column to conditionally display red if the number on the "Staff" column is 10 less than the number on the "...
Vikram_Samal
May 27, 2020MCT
Chris Cundy I think you are looking something like this:
To achieve this you can use the below code:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if([$Staff]<10, '#FFA07A', '')"
}
}Hopefully this should help. Provide appropriate response if it helps to reach your solution.
Thanks
Vik