I am working on some custom JSON using the "rowFormatter" view formatting schema. I want to display an Icon depending on the value in another Column.
My conditional statement is not working. Any help is appreciated.
"children": [
{
"elmType": "span",
"txtContent": "[!DataDomain.DisplayName]",
"style": {
"display": "block",
"color": "#333333",
"text-align": "left",
"font-size": "12px",
"font-weight": "bold",
"padding-top": "10px"
}
},
{
"elmType": "span",
"attributes": {
"iconName": "=if ([$DataDomain] == 'Property', 'CityNext', if([$DataDomain]== 'Tenant', 'People', if ([$DataDomain] == 'Financial', 'Financial', if ([$DataDomain] == 'Client', 'AccountManagement', if ([$DataDomain] == 'Employee', 'WorkforceManagement', if ([$DataDomain] == 'Market/External', 'Source'))))))",
"class": "ms-fontColor-neutralPrimary"
},
"style": {
"display": "inline"
}
},
{
"elmType": "span",
"txtContent": "=if ([$DataDomain] == '', '–', [$DataDomain])",
"style": {
"display": "inline",
"font-size": "12px",
"padding-left": "5px"
}
}
]