SharePoint 列格式 - 大写或小写文本的条件?

SharePoint column formatting - Condition on text that could be upper or lower case?

我有一个 SharePoint 列表,其中有一列是从 MS 表单填充的,用户填写的字段是自由文本,但他们需要在框中至少输入 n/a。如果内容不是 n/a,我试图开始工作的格式会将字段的背景更改为红色。由于 JSON 区分大小写,我需要能够检查 n/a 和 N/A,我找到了使用 (ToLowerCase) 的参考,但我对 JSON 的了解有限在这里没有帮助我。

当前JSON

{
  "elmType": "div",
  "style": {
    "box-sizing": "border-box",
    "padding": "0 2px"
  },
  "attributes": {
    "class": {
      "operator": ":",
      "operands": [
        {
          "operator": "!=",
          "operands": [
            "@currentField",
            "n/a"
          ]
        },
        "sp-css-backgroundColor-errorBackground50",
        ""
      ]
    }
  },
  "children": [
    {
      "elmType": "span",
      "style": {
        "line-height": "16px",
        "height": "14px"
      },
      "attributes": {
        "iconName": {
          "operator": ":",
          "operands": [
            {
              "operator": "!=",
              "operands": [
                "@currentField",
                "n/a"
              ]
              ]
            },
            "",
            ""
          ]
        }
      }
    },
    {
      "elmType": "span",
      "style": {
        "overflow": "hidden",
        "text-overflow": "ellipsis",
        "padding": "0 3px"
      },
      "txtContent": "@currentField",
      "attributes": {
        "class": {
          "operator": ":",
          "operands": [
            {
              "operator": "!=",
              "operands": [
                "@currentField",
                "n/a"
              ]
            },
            "",
            ""
          ]
        }
      }
    }
  ]
}

如有任何帮助,我们将不胜感激。

谢谢 罗布

您可以试试下面的格式。

{
  "elmType": "div",
  "style": {
    "box-sizing": "border-box",
    "padding": "0 2px"
  },
  "attributes": {
                "class": "=if(toLowerCase(@currentField) != 'n/a', 'sp-css-backgroundColor-errorBackground50', '')"
            },
  "children": [
    {
      "elmType": "span",
      "style": {
        "line-height": "16px",
        "height": "14px"
      },
      "attributes": {
        "iconName": {
          "operator": ":",
          "operands": [
            {
              "operator": "!=",
              "operands": [
                "@currentField",
                "n/a"
              ]              
            },
            "",
            ""
          ]
        }
      }
    },
    {
      "elmType": "span",
      "style": {
        "overflow": "hidden",
        "text-overflow": "ellipsis",
        "padding": "0 3px"
      },
      "txtContent": "@currentField",
      "attributes": {
        "class": {
          "operator": ":",
          "operands": [
            {
              "operator": "!=",
              "operands": [
                "@currentField",
                "n/a"
              ]
            },
            "",
            ""
          ]
        }
      }
    }
  ]
  }