💡 What is Delegation in Power Apps?
Delegation means pushing data operations (like filtering, sorting, searching) to the data source, so they run server-side — instead of pulling all the data into Power Apps and processing it locally.
Why it matters:
• SharePoint (and most connectors) limits Power Apps to retrieving only the first 500 items by default (can be increased to 2000).
• If an operation isn’t delegated, Power Apps pulls in data locally — and anything beyond the limit is simply ignored.
⛔ This leads to incomplete results and unexpected behavior.
⸻
⚠️ Common Delegation Warnings (with SharePoint)
You’ll often see yellow warning triangles like:
“The function ‘Filter’ has some part that cannot be delegated and might not return the expected results.”
Some non-delegable operations in SharePoint:
• Search()
• StartsWith(), EndsWith() (on multi-line text)
• LookUp() with complex conditions
• Filtering on calculated columns, choice columns, or multi-value fields
🛠️ How to Solve Delegation Issues (Best Practices)
✅ 1. Use Delegable Functions Only
Stick with delegable functions like:
• Filter(), Sort(), Search() (only partially delegable with SharePoint)
• StartsWith() (delegable only with SharePoint text columns — not lookups or choice fields)
• Logical operators: And, Or, =, <>
📌 Example:
// ✅ Delegable
Filter(Tasks, Status = "Completed")
// ❌ Not Delegable
Filter(Tasks, Text(Status) = "Completed")
✅ 2. Avoid Complex Column Types
• Avoid filtering directly on choice, lookup, calculated, or person/group columns.
• Workaround: Create additional plain text fields to store the value and filter on those.
⸻
✅ 3. Use Collections (with Caution)
If delegation isn’t possible and data is limited:
ClearCollect(colTasks, Filter(Tasks, Status = "Completed"))
⚠️ Only works up to the delegation limit (500–2000 items max). Don’t rely on this for large datasets.
⸻
✅ 4. Increase the Delegation Limit (Temporary Fix)
Go to:
App Settings → Advanced Settings → Data row limit
Increase to max (2000 rows).
⚠️ Still not a long-term fix. You’re only extending the boundary, not solving the core issue.
✅ 5. Use Views in SharePoint
• Create a filtered view in SharePoint with pre-applied filters.
• Connect to the view in Power Apps using Filter() — this limits data returned from SharePoint directly.
✅ 6. Consider Moving to Dataverse or SQL
If your app relies heavily on filtering/searching large lists, SharePoint may not scale well.
✅ Dataverse or Azure SQL offer full delegation, better indexing, and are designed for relational data access.
🧠Final Tips
• Keep an eye on yellow warnings in your app — they’re trying to help you!
• Test your filters with more than 2000 records to confirm behavior.
• If data scale matters: SharePoint is a list, not a database — know when to switch.
Comments