SharePoint List only returns 100 items in Azure Logic App

I was reading a SharePoint List using the “Get Items” activity in an Azure Logic App. I explain how you can create such a Logic App in the blog post Reading a SharePoint List with Azure Logic App.

It all worked fine for a while, but recently the list grew larger than 100 items. Suddenly, I started getting complaints that some items didn’t make it into the data warehouse. What’s going on? I ran the Logic App and I could see only 100 items were inserted into the SQL Server table:

(I realize the Logic App is doing a row-by-row insert, which is really slow. But for a small data set loaded only once a day, I don’t really care)

You can check the exact JSON output of the Get Items activity by clicking on “Show raw outputs”. And the output also only had 100 items. Luckily, the solution wasn’t that complicated. The OData feed responsible for exporting the SharePoint List applies pagination. This means only the first 100 items of the list are returned, alongside with an URL on how to retrieve the next 100 items (you can find it in the JSON if you’re really interested in the details). Fortunately, we can just enable pagination in the settings!

Switch the slider for pagination to on, and specify a threshold value (I read somewhere this is maximum 5000, but don’t take my word for it). Don’t forget to hit Done at the bottom AND to save your Logic App!


------------------------------------------------
Do you like this blog post? You can thank me by buying me a beer 🙂

Koen Verbeeck

Koen Verbeeck is a Microsoft Business Intelligence consultant at AE, helping clients to get insight in their data. Koen has a comprehensive knowledge of the SQL Server BI stack, with a particular love for Integration Services. He's also a speaker at various conferences.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.