people フィールドを含む基本的な sharepoint リストがあります。rest API を使用して新しいリスト項目を追加し、person フィールドをエイリアスに設定しようとしていますが、機能せず、エラーが発生します。ユーザーデータの受け渡し方法に問題があるようですが、オンラインでヘルプを見つけることができませんでした。
この電話をかける正しい方法を手伝ってもらえますか。どんな助けでも大歓迎です。
私のコード-------
function runAjax(){ var d = JSON.stringify({"__metadata":{"type":"SP.Data.RepositoryItem"},"Owners":"-1;#v-mynme@microsoft.com"});
jQuery.ajax({
url: "https://microsoft.sharepoint.com/sites/mysite/docstore/_api/web/lists/GetByTitle('Repository')/items(1580) ",
type: "POST",
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"X-HTTP-Method": "MERGE",
"If-Match": "*"
},
data:d,
success: function (_a) {
console.log(JSON.stringify(_a));
},
error: function (_e) {
console.error(JSON.stringify(_e));
}
});}runAjax();
私が得ているエラーは
Updation fail
{"readyState":4,"responseText":"{\"error\":{\"code\":\"-1, Microsoft.SharePoint.Client.InvalidClientQueryException\",\"message\":{\"lang\":\"en-US\",\"value\":\"A 'PrimitiveValue' node with non-null value was found when trying to read the value of a navigation property; however, a 'StartArray' node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected.\"}}}","status":400,"statusText":"Bad Request"}