1

How is get value People Picker JQuery SP 2013? Isn't work my code ((

enter image description here

function _spBodyOnLoad(){
var pickerPeople = SPClientPeoplePicker.SPClientPeoplePickerDict['User'].GetAllUserInfo();
if (pickerPeople.length > 0) {
    alert("User: " + pickerPeople[0].DisplayText);
} }

1 Answer 1

3

Following code might helps you

var ClientPickerDict = this.SPClientPeoplePicker.SPClientPeoplePickerDict;
    // Get the people picker object from the page.
    for (var propertyName in ClientPickerDict) {
        peoplePicker = ClientPickerDict[propertyName];
    }
    if (peoplePicker != null) {
        // Get information about all users.
        var users = peoplePicker.GetAllUserInfo();
        var userInfo = '';
        for (var i = 0; i < users.length; i++) {
            var user = users[i];
            userInfo += user['Key'] + ";#";
        }
        return userInfo;
    }
3
  • var ClientPickerDict = this.SPClientPeoplePicker.SPClientPeoplePickerDict['User'] error is null? Commented Nov 28, 2018 at 11:26
  • How did you bind people picker? did you use sppeoplepicker.js? Commented Nov 28, 2018 at 11:27
  • I'm using sppeoplepicker.js return is blank Commented Nov 28, 2018 at 11:34

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.