The correct SharePoint CAML query to retrieve all items from a list

camlsharepointsuds

For some reason I am trying to query SharePoint 2007 using CAML and web services with the Python suds library. The call looks like:

listItems = client.service.GetListItems(
    listName, '', Raw('<Query />'), viewFields, 0, 
    Raw("""<QueryOptions>
       <IncludeMandatoryColumns>TRUE</IncludeMandatoryColumns>
       </QueryOptions>"""), 
    None)

For some reason, I get 0 results or an error with <Query/> or <Query><Where/></Query> but get all items with a simple tautology WHERE x = 1 OR x != 1.

What is the correct way to just get all list items?

Best Answer

To get all items, just put an orderby clause in there, and specify an arbitrary column. Should return everything...

Related Topic