Sharepoint 2013 REST API not returning all items for a list

后端 未结 4 952
囚心锁ツ
囚心锁ツ 2021-02-13 19:38

The title states my problem quite exactly. If I try to gather all 400+ items from a list using sharepoint\'s REST API, I only get first 100.

I have read http://msdn.micro

4条回答
  •  广开言路
    2021-02-13 20:30

    Adding to Christophe's answer I would say listing all (potentially 5000) items in a list and parsing them would result in performance issues.

    If you query sharepoint to show all items in a particular list it would only print out the first 100. But the xml response also provides the url to query for the next 100 list items.

    At the very end of the xml response you will see a tag like this

    
    

    The url inside href="...."is what you'll need.

    Querying the above would provide you with a list of the next 100 or less items. If there are still more items left this xml response would in turn provide an other tag and if not this tag won't exist.

    Better to handle 5000 items in sets of 100 rather than them all together in my opinion.

提交回复
热议问题