This project has moved and is read-only. For the latest updates, please go here.

GetListItems RecursiveAll Doesn't Return What Is Expected

Jan 13, 2012 at 6:37 PM

I've seen some previous discussions about "flattening" document libraries to return the underlying documents but I have been unsuccessful so far. Can someone tell me if there is another method. The folder structure is as follows:

General Docs > Customer> Customer Status Reports > 2012

Under 2012 there are many files with 'Status' in the title. When I run the query below it returns "Customer Status Reports" but none of the actual files. Is there another method I can use?

        operation: "GetListItems",
        webURL: "",
        async: false,
        listName: "General Docs",
        CAMLQueryOptions: "<QueryOptions><ViewAttributes Scope='RecursiveAll'/></QueryOptions>",
        CAMLQuery: "<Query><Where><Contains><FieldRef Name='Title' /><Value Type='Text'>Status</Value></Contains></Where></Query>",
        CAMLViewFields: "<ViewFields>"
                        + "<FieldRef Name='Title' />"
                        + "</ViewFields>",
        completefunc: function (xData, Status) {
            $(xData.responseXML).find("[nodeName='z:row']").each(function() {
                var test = $(this).attr("ows_Title");

Jan 13, 2012 at 8:09 PM

Are you sure that Title is what you want to be filtering on? What do some of the Titles of the documents in the 2012 folder look like?


Jan 17, 2012 at 5:21 PM

Hi Marc,

Thank you for your prompt reply. I fixed whatever was wrong but I was unable to delete the post or edit it before you responded to it. I don't remember what I did to fix it but it works fine now. Thanks!

Jan 17, 2012 at 5:26 PM

Whew. Glad to hear you fixed it.