Are there an easy way to retrieve a specified library in a site with CSOM? I'm in SharePoint Online and for now, I retrieve all library and test depending title

It's not really performing well because I need to do multiple requests.


You can get list by title using

var clientContext = new SP.ClientContext(siteUrl);

var oList = clientContext.get_web().get_lists().getByTitle('Title');
  • Thanks a lot for your reply, i gonna try this tomorrow and come back with result – user1898765 May 6 '15 at 19:25
  • Hi, i tried this one but i always go to failed method when executequeryasync. Are the re a way to check if it exists (without looping all list because i have lot and lot of subsite) – user1898765 May 7 '15 at 10:16
  • Don't you know on which WEB the library is? In order for the above code to work you should pass the correct siteUrl. – Amal Hashim May 7 '15 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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