How to Apply filter, Search and SortByColumn directly in Browse Gallery without a delegation warning in Power apps(data source: SharePoint list).

This post is to help you, how to get rid of delegation warnings in the Browse Gallery while filtering out the items from a SharePoint list without using any collection. 

There are multiple ways to overcome the 5000 records limit in power apps(will cover them in coming posts).

Script: use the below script in the Items action of  Browse Gallery.

SortByColumns( Filter( [@Test],Department="HR" Or Department="IT",

      StartsWith( Title, TextSearchBox1.Text ) ), "Title", If( SortDescending1,

      Descending, Ascending ) )



  For reference:



Dry Run:
  1. The SortByColumns () function is to sort records alphabetically. 

  2. Filter() this function is to retrieve only required items from an SP list.
    e.g. employees belong to IT or HR.

  3. After retrieving the required data, we are using the StartsWith() to Search records.



Final Result:



Use case Or Where I used it?

I'm working on a requirement, where I have a list with 5000+ records and in the power app, there is a limit of 2000 items at a time or we can fetch 2000 items in a single request.

There are multiple ways to deal with this scenario but for me, the quick hack was this, where I directly used the filter on columns and filtered out the required data without any delegation warning.

Hope this could help you, give it a try! 

Thank you!

FYI, will cover in the coming posts - the best ways to retrieve more than 5000 records from a SharePoint list.

Comments

Popular posts from this blog

Power Apps June 2023 Updates (Canvas App Focused)

Effortlessly Import JSON Data into SharePoint with Power Automate Flow: A Step-by-Step Guide

Unleash the Power of Power Apps: Retrieve Over 2000 Records from a SharePoint List Effortlessly Without Delegates