SharePoint sp pnp js清除/空多用户字段
看看这里提供的例子 我试图清除“更新多用户”字段,但它不清除。我错过了什么?我尝试将其设置为null或空数组,但都因请求错误而失败SharePoint sp pnp js清除/空多用户字段,sharepoint,sharepoint-online,Sharepoint,Sharepoint Online,看看这里提供的例子 我试图清除“更新多用户”字段,但它不清除。我错过了什么?我尝试将其设置为null或空数组,但都因请求错误而失败 pnp.sp.web .lists.getByTitle('Agreements') .items.getById(agreement.Id) .update({
pnp.sp.web
.lists.getByTitle('Agreements')
.items.getById(agreement.Id)
.update({
Notes: 'Notes go here..',
// Clear Multi User Approver Field.
CurrentApprover: { results: [] },
})
.then((result) => {
resolve({ result: true });
}).catch((e) => {
console.log(e);
});
对于用户字段值,字段名称应作为Id引用。例如,对于具有CurrentApprover名称的字段,该字段应作为CurrentApprover Id引用。这可能就是在您的案例中更新时忽略用户字段值的原因 更新示例
pnp.sp.web
.lists.getByTitle('Agreements')
.items.getById(agreement.Id)
.update({
Notes: 'Notes go here..',
// Clear Multi User Approver Field.
CurrentApproverId: { results: [] },
})
.then((result) => {
resolve({ result: true });
}).catch((e) => {
console.log(e);
});
嘿,很抱歉反应太晚了。是的,非常感谢,接得好!