Search code examples
sharepointcaml

CAML queries: how to filter folders from result set?


I'm using caml query to select all documents which were modified or added by user. Query runs recursively on all subsites of specified site collection.

Now problem is I can't get rid of folders which are also part of result set. For now I'm filtering them from result datatable. But I'm wondering: Is it possible to filter out folders from result set just by using caml?


Solution

  • This CAML actually does the trick:

    <Where>
        <Eq>
            <FieldRef Name='FSObjType' />
            <Value Type='Integer'>0</Value>
        </Eq>
    </Where>
    

    that will not give you any folders.