我尝试设置共享点列表项和更新列表,现在共享点列表是具有多个值的查找
我打电话给
开机自检
/ sites / {} / lists / {list_guid} / items / {item_id} / fields
和Json
{
"MyListLookUpValue":[
"LookupId":1,
"LookupValue":"My name",
"Email":"my@email.se",
]
}
(这不是我使用的代码,而是一种表示形式)
我发现我应该指定类型,但事实是我不知道类型(如果它将是我可以添加的字符串列表)
"MyListLookUpValue@odata.type":"Collection(Edm.String)"
遇到类似问题的任何人都必须指定类型?
不明白为什么他们需要使它如此困难。
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.InvalidClientQueryException",
"message": "A value without a type name was found and no expected type is available. When the model is specified, each value in the payload must have a type which can be either specified in the payload, explicitly by the caller or implicitly inferred from the parent value.",
"innerError": {
"request-id": "2aaa2c86-f922-414b-b9c9-f892588b0bea",
"date": "2019-02-28T17:05:05"
}
}
}
解决方案
在评论帮助下,我得到了这个有效的答案
{
"MyListLookUpValueLookupId@odata.type" : "Collection(Edm.Inte32)"
"MyListLookUpValueLookupId": [1,2,3]
}