I can get the formatting to render the background and font style for the column text but not the icons in the children element. I have messed with this for days. I must use style elements as opposed to ms classes because I need this to render properly in a list view web part. Does anyone see what is causing it to skip this? Any help is much appreciated! Where is the mistake?
{
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Green"
]
},
"#2ECC71",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Red"
]
},
"#E74C3C",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Yellow"
]
},
"#F1C40F",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
"@currentField",
"Purple"
]
},
"#76448A",
""
]
}
]
}
]
}
]
},
"children": [
{
"txtContent": "@currentField",
"style": {
"font-size": "2em",
"display": "inline-block",
"padding": "0 8px",
"attributes": {
"iconName": "=if(@currentField == 'Green', 'Emoji2', if(@currentField == 'Yellow','EmojiNeutral', 'EmojiDisappointed'))"
}
}
}
],
"color": "#fff",
"font-size": "2em",
"padding-left": "14px",
"white-space": "nowrap"
}
}
