What is the best method to read data of a sharepoint's list with a solution sharepoint online, I tried already method SPservices() and Rest/API but I obtains errors.

  • Can you elobrate? you want to read list items in SharePoint Hosted App? and what exact error are you getting?
    – Anuja
    Aug 9, 2016 at 3:43

1 Answer 1


Try below code to read the list items.

 var context = SP.ClientContext.get_current();//Get current app web context
    var mylist;
    this.web = context.get_web();
    mylist = this.web.get_lists().getByTitle('My List');
    var camlQuery = new SP.CamlQuery();
    camlQuery.set_viewXml('<Query><OrderBy><FieldRef Name=\'ID\'/></OrderBy></Query>');
    var collListItem = mylist.getItems(camlQuery);
     Function.createDelegate(this, success),
     Function.createDelegate(this, error)

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.