【发布时间】:2020-03-21 07:27:25
【问题描述】:
我正在使用 SharePoint Online:
我有一个包含几个多选字段的表单。当我尝试添加项目时,我收到以下错误:
"value: "在尝试读取属性值时,从 JSON 读取器中读取了“StartArray”类型的节点;但是,需要一个 'PrimitiveValue' 或 'StartObject' 节点。”
这是多选的代码和字段。
$.ajax({
url: fullUrl,
method: "POST",
data: JSON.stringify({
'__metadata': { 'type': 'SP.Data.AuditItem' },
'Register': that.register,
'RiskRegister': that.nextIndex,
'Reopen': that.formatDate(that.reopen),
'RiskOrIssue': that.riskOrIssue,
'Locations': that.locations, //<---multi-select choice field
'ProblemT': that.probTitle,
'ProblemStatement': that.problemStatement,
'TaskOwner': that.taskOwner,
'RiskOwner': that.riskOwner,
'Auditor': that.auditor //<--- multi-select choice field
}),
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val()
},
success: function(){
alert("Item Added!");
},
error: function(data){
console.log(data);
}
});
我该如何解决这个问题?
谢谢!
【问题讨论】:
标签: jquery rest sharepoint sharepoint-online