Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have used following code to add users and groups to a list item of type SpFieldUserValue. it works if there is one single user or group in my client side people picker but if there is more than one Entity in the people picker then it says "the user does not exist or is not unique"

 var users = peoplePicker.GetAllUserInfo();
 for (var i = 0; i < users.length; i++) {
     userName = user["Description"];                
     myArray.push(SP.FieldUserValue.fromUser(userName));
 }

in another method:

 requestedSiteItem.set_item('Owner', myArray);
share|improve this question
    
I think this thread is what you are looking for: sharepoint.stackexchange.com/questions/47872/… –  Vardhaman Deshpande Mar 8 '13 at 17:11
    
thanks for your answer. I have alrady seen this thread. Using javascript and array, but it works only when the array contains one item. when the array contains more than one item it generates error –  Medes Mar 8 '13 at 21:56

1 Answer 1

up vote 1 down vote accepted

Does the column support multiple users ?

If you have a custom people picker in the page to which you are trying to add, make sure that "AllowMultiple" is set in the HTML markup

share|improve this answer
    
Thank you this solved my problem, I went to list settings, chose the column and changed "allow Multiple selections" to "YES". But I can't find it in the markup for the column in the schema file. what is its name? AllowMultipleVote or something? thanks again. –  Medes Mar 11 '13 at 9:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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