Can I use PnP JS library to get all Users to populate a People Picker Control ?



1 Answer 1


To populate a custom drop-down ( which you are calling as people picker field), first get the users from the site using following snippet:

 $pnp.sp.web.siteUsers.get().then(function(data) {
    var users = "";
    for (var i = 0; i < data.length; i++) {
        users += data[i].Id + " - " + data[i].Title + "<br/>";
    document.getElementById("sample").innerHTML = users;

Now populate the drop-down with the above users, refer this

  • this will get all site users, is there any method to get all tenant level user. then i have to add that users to site. Nov 27, 2018 at 12:22

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.