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 am trying to find the Author Name(created by) for a given Item Id using the SP Client context in SharePoint 2010.

Below the code snippet

var ctx = new SP.ClientContext.get_current();

        //this.web = ctx.get_web().get_lists().getByTitle(;

        var query = new SP.CamlQuery();

        var queryStr = "<View><Query><Where><Eq><FieldRef Name=\'Series\' /><Value Type=\'Choice\'>Sample</Value></Eq></Where></Query></View>";

        alert( queryStr );

        query.viewXml = queryStr;

        var list = ctx.get_web().get_lists().getByTitle('PKS Podcasts');

        listItems = list.getItems(query);


        ctx.executeQueryAsync(Function.createDelegate(this, this.onSuccess), Function.createDelegate(this, this.onFail));

    function onSuccess(sender, args) {      
          var listEnumerator = listItems.getEnumerator();
          while (listEnumerator.moveNext()) {
           alert("Item containing ‘announce’ found! \nTitle: " + listEnumerator.get_current().get_item("Author"));                      

    function onFail(sender, args) {
        alert('failed to get list. Error:'+args.get_message());

But it is returning the object and not able to get the Author there a way to find the same?

share|improve this question
found a way of doing it... alert("Item containing ‘announce’ found! \nTitle: " + listEnumerator.get_current().get_item("Author").get_lookupValue()); – Karthikeyan Jun 16 '11 at 20:12
Can you please move your comment into an answer? Then you can mark the question as answered. Thanks! – Alex Angas Aug 26 '11 at 4:55

Solution moved from comment:

alert("Item containing ‘announce’ found! \nTitle: " + 
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.