我有一个SharePoint列表,列有"Status -全局(查找)“,它的类型是”查找“。它从另一个列表中获取信息,只有5个值:“红色”、“琥珀”、“绿色”、“灰色”或空白值。
根据本文:https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting,我将条件列格式应用于列“状态-总体(查找)”。
下面是JSON代码,它被粘贴到列表列的“列格式”设置中:
{
"$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
"debugMode": true,
"elmType": "div",
"attributes": {
"class": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toString()",
"operands": [
"@currentField.lookupValue"
]
},
"Green"
]
},
"sp-field-severity--good",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toString()",
"operands": [
"@currentField.lookupValue"
]
},
"Gray" ]
},
"sp-field-severity--low",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toString()",
"operands": [
"@currentField.lookupValue"
]
},
"Amber"
]
},
"sp-field-severity--warning",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toString()",
"operands": [
"@currentField.lookupValue"
]
},
"Red"
]
},
"sp-field-severity--severeWarning",
"sp-field-severity--blocked"
]
}
]
}
]
}
]
}
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
"attributes": {
"iconName": {
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toString()",
"operands": [
"@currentField.lookupValue"
]
},
"Green"
]
},
"CheckMark",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toString()",
"operands": [
"@currentField.lookupValue"
]
},
"Amber"
]
},
"Forward",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toString()",
"operands": [
"@currentField.lookupValue"
]
},
"Gray"
]
},
"Error",
{
"operator": "?",
"operands": [
{
"operator": "==",
"operands": [
{
"operator": "toString()",
"operands": [
"@currentField.lookupValue"
]
},
"Red"
]
},
"Warning",
"ErrorBadge"
]
}
]
}
]
}
]
}
}
},
{
"elmType": "span",
"txtContent": "@currentField.lookupValue"
}
]}除了显示以下错误的空白值外,此JSON对所有查找值都很好:
(列内部名称)在数据对象上找不到.lookupValue。

有办法解决这个问题吗?
发布于 2018-03-23 11:24:25
我在这里得到了回应:https://github.com/SharePoint/sp-dev-column-formatting/issues/36
解决方案是将"debugMode“从”true“改为”false“。现在,条件格式工作正常,没有任何错误。
https://stackoverflow.com/questions/49392815
复制相似问题