0

I found many articles on how to add user in Person or Group column using JSOM, but i couldn't find any article which shows how to add SharePoint group in Person or Group column using JSOM.

Could someone help me in this!!!

1

The following example demonstrates how to set Group as a field value via SharePoint JSOM API.

Lets assume group variable represents SP.Group object which has been retrieved from the server, then list item user field value for a SharePoint Group could be set like this:

let groupVal = new SP.FieldUserValue();
groupVal.set_lookupId(group.get_id());

listItem.set_item(userFieldName, groupVal);
listItem.update();
ctx.executeQueryAsync(() => {
     //...
}, (sender, args) => {
    //handle error
});

Example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.