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(); } 
1

1 Answer 1

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.

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.