Office365-REST-Python-Client icon indicating copy to clipboard operation
Office365-REST-Python-Client copied to clipboard

Read large lists, using filter(), order_by() and top()

Open chelsy-mena opened this issue 2 years ago • 2 comments

I am currently trying to read only the last week's entries of a few lists, and I accomplish this by using filter("Modified gt datetime{date_in_isoformat}') or order_by("Modified desc").top(50) along with get(); but now one of my lists has crossed the 5000 entries threshold and I get a 500 Error because of it, if I use paged(5000) or get_all(5000) it doesn't seem to work with filter() or order_by() and top().

Is this a limitation? Do I need to chain these in a specific order?

Thank you for any insight

chelsy-mena avatar May 17 '23 15:05 chelsy-mena

You can use the filter syntax on lists larger than the 5000 threshold if the column you are referencing is set to indexed in the list configuration. e.g. list_object.items.filter(filterText).get_all().execute_query()

InMDK avatar Feb 21 '24 15:02 InMDK