I found this this documentation on how to use the client side people picker and have it working on my page. Basically you load a bunch of js files, setup a schema, and then initialize the picker.
I'm trying to find any documentation of how you set up the schema and what kind of values you can use.
// Create a schema to store picker properties, and set the properties.
var schema = {};
schema['PrincipalAccountType'] = 'User,DL,SecGroup,SPGroup';
schema['SearchPrincipalSource'] = 15;
schema['ResolvePrincipalSource'] = 15;
schema['AllowMultipleValues'] = true;
schema['MaximumEntitySuggestions'] = 50;
schema['Width'] = '280px';
// Render and initialize the picker.
// Pass the ID of the DOM element that contains the picker, an array of initial
// PickerEntity objects to set the picker value, and a schema that defines
// picker properties.
this.SPClientPeoplePicker_InitStandaloneControlWrapper(peoplePickerElementId, null, schema);
For example I figured out that PrincipalAccountType
values of User means users, SecGroup is some kind of security group, and SPGroup is SharePoint groups. I couldn't figure out what DL is for. What exactly do those mean and are those the only choices?
I also can't figure out what properties I can use in the schema. Are those the only ones?
This documentation seems to list the properties for the people picker, but they don't quite match up. For example, in the code sample I found there is a schema['AllowMultipleValues']
but in the property list there is AllowMultipleEntries
.
From the list of properties I've tried some like Tooltip
which didn't work, but Title
did set the tooltip.
Does anyone have a good source of information on how to actually work with and configure a client side people picker when using javascript on the page?
Edit Bonus question
In the init function what is the second argument? Must it always be null
?
SPClientPeoplePicker_InitStandaloneControlWrapper(pickerElementId,null,schema)