SharePoint

SharePoint Delegation Cheat Sheet For Power Apps

SharePoint Delegation Cheat Sheet For Power Apps Posted by - Matthew Devaney on - February 5, 2023 43 Comments This SharePoint delegation cheat sheet is the ...

Matthew Devaney
Published
Reading time
5 min read

Before you start

Is this guide for you?

Best entry point
SharePoint
Time investment
5 min read

Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/sharepoint-delegation-cheat-sheet-for-power-apps/. Author: Matthew Devaney.

SharePoint Delegation Cheat Sheet For Power Apps Posted by - Matthew Devaney on - February 5, 2023 43 Comments

This SharePoint delegation cheat sheet is the quickest way to check which Power Apps functions support delegation. When you get a delegation warning like this: “the Filter part of this formula may not work correctly on large data sets”, change your code to only use functions found on this page. It will remove the delegation warning. Table of Contents

Power Apps Functions With Full Delegation Support In SharePoint

Power Apps Functions With Partial Delegation Support In SharePoint

Known Workarounds For Non-Delegable Power Apps Functions In SharePoint “>IsBlank “>Search “>Create Collections Over 2,000 Rows “>Double Collection Size To 4,000 Rows “>ForAll + Filter Loop

Column Indexing For Large Datasets Over 5,000 SharePoint List Items

Power Apps Functions With Full Delegation Support In SharePoint

When these functions are used to get data from SharePoint the full result is returned. Filter LookUp Sort [1] SortByColumns [1] StartsWith And , Or [2] = , < , <= , <> , > , >= [3] Notes

Sort & SortByColumns function does not support delegation on complex column types: Choice, LookUp, Person, etc.

Not operator does not support delegation

SharePoint ID column only supports the = operator. Does not support <, <=, <>, >, >=

Power Apps Functions With Partial Delegation Support In SharePoint

When these functions are used to get data from SharePoint only the first 500 records are returned by default. AddColumns ClearCollect Collect DropColumns RenameColumns ShowColumns

This can be increased to 2,000 records by changing the data row limit in the Power Apps advanced settings menu.

Known Workarounds For Non-Delegable Power Apps Functions In SharePoint

Delegation is not supported for these Power Apps functions in SharePoint. IsBlank Function

The IsBlank function does not support delegation in SharePoint.

Filter( 'SharePoint List' , IsBlank(Title)) Code language: JavaScript ( javascript )

We can use the Blank function to achieve the same result.

Filter( 'SharePoint List' , Title=Blank()) Code language: JavaScript ( javascript ) Search Function

The Search function does not support delegation in SharePoint.

Search( 'SharePoint List' , "Cat" , "Title" ) Code language: JavaScript ( javascript )

We can use the StartsWith function to get all results where the start of the word matches the search terms.

Filter( 'SharePoint List' , StartsWith(Title, "Cat" )) Code language: JavaScript ( javascript )

A full delegation workaround for the Search function is possible by performing the search in a Power Automate flow and sending the result back to Power Apps. Create Collections Over 2,000 Rows

The ClearCollect function supports partial delegation in SharePoint. However, there are ways to create collections over 2,000 rows .

ClearCollect(colCollectionName, 'SharePoint List' ) Code language: JavaScript ( javascript ) Double Collection Size To 4,000 Rows

We can use this Power Apps code to load up to 4,000 rows into a collection. First, we load the list data into 2 temporary collections. The 1st temporary list is sorted in ascending order and the 2nd temporary list is sorted in descending order. Then we merge both temporary collections into a single collection and remove the duplicates.

This technique only returns the full result when the filtered SharePoint list contains less than or equal to 4,000 items. For more information check out this article .

Concurrent( ClearCollect( colChunk1, Sort( 'SharePoint List' , ID, Ascending) ), ClearCollect( colChunk2, Sort( 'SharePoint List' , ID, Descending) ) ); ClearCollect( colYourCollectionName, colChunk1, Filter(colChunk2, Not(ID in colChunk1.ID)) ); Clear(colChunk1); Clear(colChunk2); Code language: JavaScript ( javascript ) ForAll + Filter Loop

The ForAll function can also be used to exceed the delegation limit. It can loop over a set of single column table of values an return the results into a collection. The only limitation is each iteration of the loop can only return up to 2,000 results. For a full example of the technique check out this article .

Clear(colYourCollectionName); ForAll( [ "New" , "Submitted" , "Approved" ], Collect( colYourCollectionName, Filter( 'SharePoint List' , SubmissionStatusColumn=Value) ) ); Code language: JavaScript ( javascript )

Column Indexing For Large Datasets Over 5,000 SharePoint List Items

When the number of items in a SharePoint list exceeds 5,000 items the following warning appears . The Power Apps Filter function and LookUp function will not evaluate any items past the 5,000th item in the list until column indexing is turned on. Each column used in the filter criteria must be indexed to return the full result.

“The number of items in this list exceeds the list view threshold, which is 5000 items. Tasks that cause excessive server load (such as those involving all list items) are currently prohibited.”

To enable column indexing open the SharePoint list settings… …and select Indexed columns .

Choose the column to be indexed from the dropdown menu and click Create .

There can be up to 20 indexed columns on the same SharePoint list. Did You Enjoy This Article? 😺

Subscribe to get new Copilot Studio articles sent to your inbox each week for FREE Enter your email address Sign Me Up

Questions About Delegation In SharePoint?

If you have any questions about Power Apps + SharePoint Delegation Cheat Sheet please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion. Matthew Devaney M365 Copilot Power Apps

How To Create Copilot Custom UI Widgets In Power Apps

Share this

Tagged

SharePoint

Have a Microsoft 365 topic idea?

Share article suggestions, community session ideas, corrections, or real-world scenarios for future nxtM365 learning notes.

Suggest a topic

Keep learning Microsoft 365

Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.

Continue learning

Next action

What to do next

Browse all tutorials →