I am trying to implement column formatting on a column that can have a value from (1-17)
Pseudocode
=IF(value<=4,"Low",
IF(value=5,"Low-Medium",
IF(value=6,"Low-Medium",
IF(value=7,"Low-Medium",
IF(value=8,"Medium",
IF(value=9,"Medium",
IF(value=10,"Medium",
IF(value=11,"Medium",
IF(value=12,"Medium-High",
IF(value=13,"Medium-High",
IF(value=14,"Medium-High",
IF(value=15,"Medium-High",
IF(value=16,"Medium-High",
IF(value>=17,"High"))))))))))))))
Json
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"attributes": {
"class": "=if(@currentField <= 4, 'sp-field-severity--blocked', '',if(@currentField == 5, 'sp-field-severity--warning', ''))"
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
"attributes": {
"iconName": "=if(@currentField <= 70, 'Error', '')"
}
},
{
"elmType": "span",
"txtContent": "=if(@currentField <= 4, 'Error', if(@currentField == 5, 'hello'))"
}
]
}
What am doing wrong? It just shows the json code in the display view