在多人或小组字段中添加用户时,如何解决SharePoint中的错误(仅限人)

时间:2019-05-06 17:50:39

标签: javascript sharepoint sharepoint-2013 sharepoint-online

我正在尝试在Sharepoint列表的多人或多组字段(仅人)中添加多个用户,但是我收到以下错误消息

“从JSON读取器读取时,发现意外的'PrimitiveValue'节点。应为'StartObject'节点。”

我已使用REST调用在Sharepoint列表中添加项目,当我在其余调用中删除多人列时,正在正确添加项目。

* {
    margin: 0;
    padding: 0;
}
body {
    display: flex;
    flex-direction: column;
    height:100vh;
    min-height:35em; /* or whatever value seem fine to you*/
}
.container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow:auto;
}
.container > div {
    overflow: scroll;
    /*height: 120px;*/
    flex:1;
    padding: 10px;
}
header, footer {
    background: darkslateblue;
    color: white;
    padding: 20px;
}

错误消息如下:

<header>lol</header>

    <div class="container">
        <div>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br></div>            
        <div>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br></div>            
        <div>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br></div>            
        <div>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br></div>            
        <div>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br></div>            
        <div>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br></div>            
        <div>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br></div>            
        <div>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br>dummy text<br></div>            
    </div>

    <footer>foo bar</footer>

1 个答案:

答案 0 :(得分:2)

尝试以下JSON数据格式。

{
            "__metadata": { "type": "SP.Data.MyList2ListItem" },
            "Title": "RestApiCreated",
            "MultiUsersId": { "results": ["12", "23"] }
        }