【问题标题】:JSON Formatting on SharePoint List column to enable cascading dropdownSharePoint 列表列上的 JSON 格式以启用级联下拉列表
【发布时间】:2022-01-05 08:03:55
【问题描述】:

一直在编写一些示例代码,以根据列表列 A 的值格式化列表列 B。

我有 2 个列表: 列表 A - 此列表是数据输入的主要列表。列是项目、地区和国家。 列表 B - 此列表包含 2 列;地区和国家。

我想要做的是,根据用户选择,只显示与选择区域对应的国家。所有国家/地区都保存在列表 B 中。

到目前为止我已经尝试过:

{
  "$schema": "https://columnformatting.sharepointpnp.com/columnFormattingSchema.json",
  "elmType": "div",
  "style": {
    "display": "inline-block",
    "padding": "10px 0 10px 0",
    "min-height": "auto"
  },
  "children": [
    {
      "elmType": "span",
      "style": {
        "display": "inline-block",
        "padding": "0 10px 0 0"
      },
      "attributes": {
        "iconName": "Folder"
      }
    },
    {
      "elmType": "a",
      "txtContent": "Show Countries",
      "attributes": {
        "target": "_top",
        "href": {
          "operator": "+",
          "operands": [
            "https://xxxxxxxxxxxx/AllItems.aspx?ID=",
            "@currentField.lookupValue",
            "[$Title]",
            "&FilterType1=Lookup"
          ]
        }
      }
    }
  ]
}

这显然不是正确的解决方案,但对于 JSON 来说,这是我通过参考 msdn 文档所能做的最好的事情。尽管最终解决方案不需要该链接,但该链接可以正常工作。基本上,我只希望用户根据地区选择看到国家。因此,我错过了显示查找值而不是“显示国家/地区”的结果。

非常感谢任何帮助或指向进一步帮助/文档的指针。

【问题讨论】:

    标签: json sharepoint cascadingdropdown sharepoint-list


    【解决方案1】:

    根据我的研究,JSON 格式不支持在 SharePoint Online 上创建级联下拉菜单。

    您可以使用SP服务(JS)创建级联下拉列表。

    参考:

    【讨论】:

    • 谢谢。最后创建了一个电源应用程序自定义表单。 :)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-20
    相关资源
    最近更新 更多