I want to set a value (person) in the SharePoint PeoplePicker using JavaScript / jQuery.

The PeoplePicker is in the div which is called "Author".

How can I trigger the event which resolves the SharePoint User and displays the appropriate User if it is available or the error message if the user was not found?

If I use jQuery and try to find the "img" element and then call the function "click()" nothing happens.

Is there another way to call the function which activates the SharePoint behavior?

3 Answers 3

//Works with SharePoint 2010
            $("div[title='People Picker']").text(strUserName);

//Works with SharePoint 2013
            try {
                //SharePoint 2013
                var travelPeoplePicker = null;
                for (var prop in SPClientPeoplePicker.SPClientPeoplePickerDict) {
                    if (prop.indexOf("YOUR_PEOPLEPICKER_FIELD_NAME_HERE") >= 0) {
                        travelPeoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[prop];
                if (travelPeoplePicker != null) {

                    var usrObj = { 'Key': strUserName };
                    travelPeoplePicker.AddUnresolvedUser(usrObj, true);
                    //$("input[title='TravelRequestor']").focus().val(strUserName).attr("size", strUserName.length);
            catch (e) {

Answer reference from Set default value in people picker javascript/jquery

  • Working fine for active users but unable to resolve the inactive users and showing error message "Multiple entries matched, please click to resolve." Mar 2, 2021 at 14:51
    $(document).ready(function ()

    //initialize PeoplePicker div tag
    function initializePeoplePicker(peoplePickerElementId) {
        var schema = {};
        schema['PrincipalAccountType'] = 'User,DL,SecGroup,SPGroup';
        schema['SearchPrincipalSource'] = 15;
        schema['ResolvePrincipalSource'] = 15;
        schema['AllowMultipleValues'] = true;
        schema['MaximumEntitySuggestions'] = 50;
        schema['Width'] = '222px';
        this.SPClientPeoplePicker_InitStandaloneControlWrapper(peoplePickerElementId, null, schema);

    //get peoplePicker value on save
    function getUserInfo() {
        AuthorUserArray = [];
        var peoplePicker = this.SPClientPeoplePicker.SPClientPeoplePickerDict.Author_TopSpan;
        var users = peoplePicker.GetAllUserInfo();
        var userInfo = '';
        for (var i = 0; i < users.length; i++) {
            var user = users[i];

    //button save function
    function btn_save()
        ListItem = Lst.getItemById(id);
        ListItem.set_item('Author', AuthorUserArray);

You can use the logIn ID or the Email of the user if you have and put it in this code.

 var peoplePicker =this.SPClientPeoplePicker.SPClientPeoplePickerDict.yourPPLpickerDivNameHere;
 var usrObj = { 'Key': loginIdOrEmail };

credit/reference : http://ranaictiu-technicalblog.blogspot.com/2014/11/sharepoint-2013-client-side-people.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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