Forum Discussion
Conditional Format SharePoint List Due Dates with three conditions - RAG
- Mar 24, 2021
misce I was recently looking for a similar resource myself. If you are still in need, this code should work for you. If you don't like the exact RAG colors, you can easily replace the them with a different HEX (here is a great site for picking colors: Color Picker Tool - Hex Colors)
{"elmType": "div","txtContent": "@currentField","style": {"background-color": "=if(Number(@currentField) == 0, '', if(@currentField >= @now + 2592000000, '#AFF8C9', if(@currentField >= @now + 86400000, '#EEBB2F', if(@currentField <= @now, '#F06C47',''))))"}}
misce I was recently looking for a similar resource myself. If you are still in need, this code should work for you. If you don't like the exact RAG colors, you can easily replace the them with a different HEX (here is a great site for picking colors: Color Picker Tool - Hex Colors)
- ganeshsanapFeb 14, 2024MVP
SteCoxy You can use font-weight parameter for showing text in bold.
Example:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "background-color": "=if(Number(@currentField) == 0, '', if(@currentField >= @now + 2592000000, '#AFF8C9', if(@currentField >= @now + 86400000, '#EEBB2F', if(@currentField <= @now, '#F06C47',''))))", "font-weight": "bold" } }
You can also use the similar expression as used for background-color if you want to show the bold text conditionally.
Please consider giving a Like if my post helped you in any way.
- emersonbruceFeb 13, 2024Copper Contributor
SteCoxy add additional items to the Style section based on your desired CSS