
Hi!
I have a list in SharePoint containing over 100K items. One of the columns is "Year," which can be either 2023 or 2024.
I have used Power Automate to export this list to CSV by using a loop that retrieves 2500 items at a time, stores them in a shared variable, and then generates a CSV from the content of the variable. In this loop, I have used a filter query: ID gt X, where "X" is the highest ID of the already retrieved items. This has worked well.
Now, I want to extend the filter query to also filter on "Year." I have tried (Year eq '2023') and (ID gt X), but this only partially works; it only manages to retrieve the first 5000 items from the list. If I use either Year eq '2023' or ID gt X alone, it will retrieve all items from the list. Both "Year" and "ID" are indexed columns.
Any idea why it stops after 5K items when I use both arguments in the filter query, but fetches all if I only use one?
what made you add the parentheses?
Have you considered using the Sharepoint Bulk API ?