Need to grab user email from SharePoint people picker and show an alert. I have tried below options but unable to get an alert after adding the name in people picker.

var supervisorPicker = SPClientPeoplePicker.SPClientPeoplePickerDict['Reportee_x0020_Of_f56eef23-35a8-4afe-8ffe-3cbf6993a7ad_$ClientPeoplePicker']

supervisorPicker.OnValueChangedClientScript = function (peoplePickerId, selectedUsersInf)
     var supervisorEmail = supervisorPicker.GetAllUserInfo()[0].EntityData.Email


var sup = $().SPFindPeoplePicker({  
    peoplePickerDisplayName: "Reportee Of"  
if(sup != undefined){

my showAlert function is like this:

function showAlert(email){
         url: "http://xxxxxxx/DataService.svc/jsonData/"+email
    }).then(function(data) {

Let me know what I am missing, and how can I grab a people picker change event to call a function and show the alert.

1 Answer 1


you can use below code to retrieve user email from custom people picker.

var user=[];
// Render and initialize the client-side People Picker.  
    function initializePeoplePicker(peoplePickerElementId) {  
        // 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'] = false;  
        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.  
        SPClientPeoplePicker_InitStandaloneControlWrapper(peoplePickerElementId, null, schema);  
         SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan.OnValueChangedClientScript=function (peoplePickerId, selectedUsersInfo) {


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.