Power Apps & SharePoint ID Delegation

Short #23 – The SharePoint ID delegation trap

Need to retrieve SharePoint items where ID > 1000? There’s a catch.

Although SharePoint’s built-in ID column is numeric, the > operator isn’t delegable for it in Power Apps. You’ll see the blue delegation warning on this formula:

Filter(Projects, ID > 1000)

On large lists this can return incomplete results, because Power Apps only processes the first 500 records by default (2,000 at most if you raise the data row limit).

What’s the workaround?

Filter on the server with Power Automate. In the Get items action, put this in Filter Query:

ID gt 1000

SharePoint applies the filter before returning anything. Turn on Pagination in the action settings if more than 100 items can match. If you need $select or $expand control, use Send an HTTP request to SharePoint instead:

GET _api/web/lists/getbytitle('Projects')/items?$filter=ID gt 1000

Keep the returned set reasonably small (filter further or use $select to trim columns), as flow responses have size limits.

I’d avoid adding a duplicate numeric column just to filter on, since you then have to keep it in sync.

Two other options

  • For a single known ID, use LookUp(Projects, ID = 1000). Equality is delegable.
  • If you just want the newest items, Sort(Projects, ID, SortOrder.Descending) is delegable.

Further reading: Working with lists and list items using REST

This entry was posted in Canvas Apps, Power Apps, SharePoint, Shorts and tagged , , . Bookmark the permalink.
0 0 votes
Article Rating
Subscribe
Notify of
guest

Solve the maths problem shown below before posting: *

0 Comments