I have what I thought was going to be a simple scenario to solve:
- Multiple SharePoint Lists, each with 40 000+ items in it
- Running queries based on different columns and export to Excel to provide MI
- To keep lists up to date and to a minimum I need power automate to check the last modified date and update items that haven't been modified for a month & Delete items that haven't been modified for 3 months.
I'm using the HTTP Get connector
with a simple filter applied as _api/Web/Lists/GetByTitle('@{outputs('querySettings')['listName']}')/Items?$select=@{outputs('querySettings')['fields']}&$filter=Modified lt 'formatDateTime(getPastTime(1, 'Month'), 'dd-MM-yyyy')'&$top=5000
Problem:
- The Get method is incredibly slow when using
Modified
date - I tried all kinds of configurations, but whenever I try to filter for either the
Created
orModified
date, theHTTP GET
part alone takes way over 15+ minutes (at which point I usually just cancel it) - Updating items takes even longer.
If I filter for a single text column for instance, I get the results back in 1 second (about 3000 items)
I can't seem to understand why power automate takes soo long with a date??! What am I missing here?
Any help would be much appreciated!