SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a small application that is making use of the SP-COM. I use the following code to get the current users email address:

ctx = SP.ClientContext.get_current();
web = ctx.get_site().get_rootWeb();
currentUser = web.get_currentUser();

Strange enough, for a couple of users the email addresse is not retrieved, even though the user has an email address when I look at the users settings-page. Looking at the json, that is coming back from the server, the email-address is also blank.

Any hints what I might be missing here?

share|improve this question

The currentUser.retrieve() is not meant to be used from code. It is reserved for internal purposes.

Also, are you using the load() and executeQueryAsync() methods which are required to fetch the data with the Client Object Model?

Try the following code:

    context = new SP.ClientContext.get_current();
    web = context.get_web();
    this._currentUser = web.get_currentUser();

    context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod),Function.createDelegate(this, this.onFailureMethod));

    function onSuccessMethod(sender, args) {



    function onFailureMethod(sender, args) {

    alert(‘request failed ‘ + args.get_message() + ‘\n’ + args.get_stackTrace());

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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