Forum Discussion
johncamp08
Jan 03, 2022Copper Contributor
Conditional Formatting
Hey! I'm have two columns on my sharepoint list (date the survey was sent) + (Installation start date). I'd like highlight the installation start date red if the date the survey was sent was wit...
Don Kirkham
Jan 03, 2022MVP
This example should get you started. The key is the formula shown on line 8 which uses the if function to turn on special classes if the comparison returns true.
{
"elmType": "div",
"children": [
{
"elmType": "span",
"txtContent": "@currentField",
"attributes": {
"class": "=if(addDays([$SurveyDate],6) < [$InstallDate],'sp-css-color-RedText sp-field-bold','')"
}
}
]
}
To learn more: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/formatting-syntax-reference#expressions
Good Luck,
Don
Please click Mark as Best Response & Like if my post helped you to answer or resolve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.