Forum Discussion
eis33
Dec 11, 2024Copper Contributor
Lookup Column content disappears with conditional formatting
Hi all, SharePoint and it pointless limitations (or bugs) drive me crazy again... I have a list, that is used by different people. As it´s still not possible to color headers or similar, I got us...
michalkornet
Dec 15, 2024Iron Contributor
Hi eis33 ,
I am not sure what happened, but I can see that even when the lookup field is set to a single value, it is treated as multi-valued in the formatting.
I edited your code, and it is now working in my case.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"debugMode": true,
"elmType": "div",
"style": {
"box-sizing": "border-box",
"padding": "0 2px",
"overflow": "hidden",
"text-overflow": "ellipsis"
},
"attributes": {
"class": "sp-field-borderRightBold sp-field-borderRightSolid sp-field-fontSizeMedium"
},
"children": [
{
"forEach": "itemIterator in @currentField",
"elmType": "div",
"txtContent": "[$itemIterator.lookupValue]",
"style": {
"padding-bottom": "1px"
}
}
]
}