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 name...is there a way to find the same?

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

1 Answer 1


Solution moved from comment:

alert("Item containing ‘announce’ found! \nTitle: " + 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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