SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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 want to retrieve only the documents that are present inside a specific folder of a document library using GetListItemsAsync method.

Here is how i call it:

sc.GetListItemsAsync("MyDocLib", null, null, null, null, 
    XElement.Parse(@"<QueryOptions><Folder>MyFolder</Folder></QueryOptions>"),
    null);

The call is returning all the documents inside "MyDocLib" and not only those that are in "MyFolder".

How can I do that?

share|improve this question
up vote 0 down vote accepted

You can try this

sc.GetListItemsAsync("MyDocLib", null, null, null, null, 
    XElement.Parse(@"<QueryOptions><Folder>MyDocLib/MyFolder</Folder></QueryOptions>"),
    null);

Notice the document library name before the folder name.

Hope this helps!

share|improve this answer

Your Answer

 
discard

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.