0

I'm getting lookupValue and lookupId from people picker filed from SharePoint list using jsom. Now I need Email address by using lookupvalue/lookupId.

Here is my code

while (listItemEnumerator.moveNext()) {
 var ProjectManager=listItemEnumerator.get_current().get_item('ProjectManager');
 var ManagerName = ProjectManager.get_lookupValue();
 var ManagerId = ProjectManager.get_lookupId();
}
2

You can get everything of a user from it's id. Like following

function getEmail(userId) {
    var context = new SP.ClientContext("https://xxx.sharepoint.com");
    var web = context.get_web();
    var user = web.get_siteUsers().getById(userId);
    context.load(user);

    context.executeQueryAsync(function() {
        console.log(user.get_email());
    }, function() {
        console.log("error");
    });
}

List of user properties can be found here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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