Forum Discussion
Column formatting now rolling out to first release users
this is just what ive been waiting for, i tried pasting / editing the json code in the appropriate place but it doesnt work, is it not up and running yet ?, is it possible our sys admin have blocked anything?
This feature is fully rolled out and to our knowledge, there's no way to block the functionality. Can you message me the JSON that you're trying that's not working? Are ALL samples that you've tried not working?
- Stephen WALKERNov 23, 2017Copper Contributor
below is the json im using, it does work (but not when I switch to classic sharepoint (lol), can you tell me how to alter this code snippet so that the cells background is red with white text in bold
{
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": {
"operator": "?",
"operands": [
{
"operator": "<=",
"operands": [
"[$Alert_x0020_date]",
"@now"
]
},
"#ff0000",
""
]
}
}
}- LincolnDeMarisNov 27, 2017
Microsoft
Column formatting only works in modern.
Try this JSON.
{
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"[$Alert_x0020_date]",
"@now"
]
},
"#ff0000",
""
]
},
"color": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"[$Alert_x0020_date]",
"@now"
]
},
"#ffffff",
""
]
}
}
}- Stephen WALKERDec 12, 2017Copper Contributor
I still have this problem, that I could do with some help with, the column in sharepoint is set as a calculated column, with the date and time format set as date only and the json code added as you sent me, but it displays like this 2016-01-03TO8:00:00Z, how can I get it to display correctly, ie 03-01-2016, it does however work correctly if I switch to classic view, is there some more json code I can put in to display it in dd/mm/yy format