Forum Discussion
SharePoint List formatting a Date column
- Jul 10, 2024
Thanks a TON! Very close, but the Cancelled and Completed items are still showing Past Dues. I need them to NOT have the code applied to them, just remain as the default settings. I don't care if they are highlighted as Past Due. Also, the entire column had its font size increased, not just the bold red ones. The non-Red ones should remain like the text in the column to the left, which is my default.
Thanks a TON! Very close, but the Cancelled and Completed items are still showing Past Dues. I need them to NOT have the code applied to them, just remain as the default settings. I don't care if they are highlighted as Past Due. Also, the entire column had its font size increased, not just the bold red ones. The non-Red ones should remain like the text in the column to the left, which is my default.
Rob, I have the code working in my sandbox but not in my live environment. Kinda tells me it's something in my Teams / SharePoint List. As you can see in the first screenie, my sandbox, there are 3 rows that are a day late and the Cancelled and Complete statuses do not show past due. That is what I am after. The second screenie in my live environment. No working, for some reason. The code is at the bottom. I do realize the first screenie says "Complete" and the second says "Completed". I have accounted for that in the code. Any Thoughts?
sandbox
live environment
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if(@currentField < @now && [$Status] != 'Complete' && [$Status] != 'Cancelled', '#FF0000','')",
"font-size": "=if(@currentField < @now && [$Status] != 'Complete' && [$Status] != 'Cancelled', '13pt', '')",
"font-weight": "=if(@currentField < @now && [$Status] != 'Complete' && [$Status] != 'Cancelled', 'bold', '')",
"justify-content": "center"
}
}
- johncrouse62Jul 11, 2024Copper Contributor
This is now working with Rob's original code he provided. Thank you Rob!