3

I've Created a Field on my list PollAnswers and everything works fine with that part:

pnp.sp.web.lists.getByTitle("PollAnswers").fields.
addUser("Users", FieldUserSelectionMode.PeopleOnly).then(() => {

But I'm unable to allow it to set Multiple Values to true doing the creating process of the field:

pnp.sp.web.lists.getByTitle("PollAnswers").fields.
addUser("Users", FieldUserSelectionMode.PeopleOnly,{"mult":true}).then(() => {

I know {"mult":true} is the problem, but I can't figure out what to write to set the user field as multiple.

Does someone know what the correct way to set the Field as Allow Multiple Values, on a User field in SharePoint?

2

You need to modify {"mult":true} to {"AllowMultipleValues":true}.

So, your code will be as below:

pnp.sp.web.lists.getByTitle("PollAnswers").fields.
addUser("Users", FieldUserSelectionMode.PeopleOnly,{"AllowMultipleValues":true}).
then(() => {
  //do some stuff
});

It is based on the FieldUser properties.

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.