Site Loader

Here is a quick and fairly simple way to programmatically populate a SharePoint 2013 People Picker field with a user based on their email address. This example assumes you have more than one People Picker field on the page. You will need:

  • The display name of the People Picker Field
  • The email address of the user you want to add to the People Picker Field

Add the following code to either a Script Editor Web Part (inside <script> tags) or on your page in the PlaceHolderAdditionalPageHead, also in <script> tags:

var dispTitle = "";
var pickerDiv = $("[id$='ClientPeoplePicker'][title='" + dispTitle + "']");
var peoplePicker = SPClientPeoplePicker.SPClientPeoplePickerDict[pickerDiv[0].id];
var usrObj = { 'Key': ''};

In one case, I had to remove the “title” attribute filter from the pickerDiv var to get it to work, but it was the only People Picker on the page, so we were good.

Hope this helps!

Eric Oszakiewski

Eric Oszakiewski is a professional software developer based in Scottsdale, AZ with over 38 years of software development experience, and 13 years SharePoint experience. He is currently working as a .Net/SharePoint Platform Engineer for General Motors.

2 Replies to “Populate a SharePoint 2013 PeoplePicker field using JavaScript/jQuery”

  1. Working fine for active users but unable to resolve the inactive users and showing error message “Multiple entries matched, please click to resolve.”

Comments are closed.