Sunday, January 17, 2016

SharePoint 2013 - Get User Title and Email

var context = new SP.ClientContext.get_current();
web = context.get_web()
 var currentUser = web.get_currentUser();
currentUser.retrieve();
context.load(web);
context.executeQueryAsync(
var userObject = web.get_currentUser();
console.log(userObject.get_email());
console.log(userObject.get_loginName());
console.log(userObject.get_title());
);

No comments: