Forum Discussion
Czyz0
Jan 06, 2023Copper Contributor
Change field BACKGROUND color based on value of ANOTHER field drop down
I'm using the JSON formatting field on column ESTVal, which is a number field. I want to show a background of GREEN when the selection in STATVal is Committed. I'm trying this JSON and see no forma...
RobElliott
Jan 07, 2023Silver Contributor
Czyz0 add the txtContent": "@currentField" line as shown below and make sure that your #FFA07A has a closing single quote which it doesn't at the moment. The correct JSON is:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if([$STATVal] == 'Committed','#FFA07A', '' )"
}
}
Rob
Los Gallardos
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
Czyz0
Jan 09, 2023Copper Contributor
I'm still not seeing any change to my background for the field. 😕
- RobElliottJan 09, 2023Silver ContributorWhat's your current JSON code looking like now you've made the changes. And if you could give a screenshot of your view of the list...