如何将列表元素的ID值附加到具有.json的链接?

时间:2019-07-01 11:03:21

标签: json sharepoint formatting sharepoint-2019

我需要您的帮助,非常感谢。

让我们说我有一个包含不同列表元素的SharePoint列表。每个列表元素都有一个特定的ID。

例如,我要执行的操作是将一列格式化为文本字段。我正在尝试编写一个.json代码,该代码将list元素的ID值附加到链接上

我确实使用以下代码尝试了

{ "$schema": "http://columnformatting.sharepointpnp.com/columnFormattingSchema.json", "debugMode": true, "elmType": "div", "children": [ { "elmType": "a", "attributes": { "target": "_blank", "href": { "operator": "+", "operands": [ "http://anywebsite?ID='", "[$ID]" ] } }, "txtContent": "Some text" } ] }

但是当我单击“确定”时,在SharePoint列中会给我一个错误:

Failure: Cannot read property 'valueOf' of null

现在我该怎么做才能将ID附加到其他列中的链接上?

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

我测试了超链接字段,在您的json中有一个不需要的

public static TaskAwaiter GetAwaiter(this System.Timers.Timer timer)
{
    // TODO
}

enter image description here

相关问题