For some reason updating person or group fields in sharepoint stopped working. This seems to happen only on SharePoint online as my on-prem version is working fine.

As soon as FieldUserValue value is added to the array i get this error when creating list item: "We couldn't find an exact match." It works if you pass a single FieldUserValue object.

I have checked and the field has "multiple users" option selected.

Here is the code example:

var arr = [];

var person = new SP.FieldUserValue();
var person2 = new SP.FieldUserValue();


  var clientContext = new SP.ClientContext.get_current();
  var oList = clientContext.get_web().get_lists().getByTitle('Test');

  var itemCreateInfo = new SP.ListItemCreationInformation();
  var oListItem = oList.addItem(itemCreateInfo);
  oListItem.set_item('Title', defaults.Title);
  oListItem.set_item('person', arr);

      Function.createDelegate(this, this.onQuerySucceeded),
      Function.createDelegate(this, this.onQueryFailed)

  function onQuerySucceeded() {
      alert('Item created: ' + oListItem.get_id());

  function onQueryFailed(sender, args) {
      alert('Request failed. ' + args.get_message() +
          '\n' + args.get_stackTrace());

I have found a solution. You have to use SP.FieldUserValue.fromUser('test1@test1.com').

Here is an example:

var user1 = SP.FieldUserValue.fromUser('test1@test1.com')
var user2 = SP.FieldUserValue.fromUser('test2@test2.com')
var itemCreateInfo = new SP.ListItemCreationInformation();
this.oListItem = oList.addItem(itemCreateInfo);
oListItem.set_item('Title', 'My New Item!');
oListItem.set_item('person', [user1 ,user2]);
| improve this answer | |

SP.FieldUserValue.fromUser works with LoginName as well, so options are not limited to email only.

| improve this answer | |

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.