首页 > 解决方案 > Microsoft 列表(共享点列表)- 多个 if 语句的条件格式问题

问题描述

在我的列表中,我有 Participant 列(1 到 6)和一个名为 Evenement 的列。

默认情况下,我希望参与者 1-5 列的背景颜色为绿色,参与者 6 列将为黄色,但如果晚上列的值为“方向”,我希望背景颜色黄色替换参与者 4 和参与者 5 列上的绿色.

我目前正在使用以下 JSON,但似乎无法使其正常工作。请注意,我对 JSON 完全陌生,并且在旅途中学习:

{
      "elmType": "div",
      "txtContent": "@currentField",
        "attributes": {
    },
    "style": {
        "background-color": 

          {
            "operator": "?",
            "operands": [
            {
                "operator": "==",
                "operands": [
                    "@currentField",
                    ""
                ]
            },
            "#98FB98", 

          {
            "operator": "?",
            "operands": [
            {
                "operator": "==",
                "operands": [
                    "@currentField",
                    "Bloqué"
                ]
            },
            "#FF6A6A", 

          {
            "operator": "?",
            "operands": [
            {
                "operator": "==",
                "operands": [
                    "[$Evenement]",
                    "Orientation"
                ]
            },
            "#FFFF66", ""
    ]
        }
    ]
        }
    ]
        }
    },
    "customRowAction": {
    },
    "children": []
}```

标签: jsonlistsharepointformattingconditional-statements

解决方案


推荐阅读