web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Is Search function del...
Power Apps
Answered

Is Search function delegable when used over other functions?

(0) ShareShare
ReportReport
Posted on by

Hi Folks,

 

I'm trying to use search function on a SharePoint list. The search is applied on top of a filtered and sorted results. It did not give me delegation warning and so far it is working fine with SPO list having 4800 items. The code I used in the gallery is shown below:

 

 

Search(
If(
 !locApprovalFiltersApplied,
 SortByColumns(
 AddColumns(
 Filter(
 'SPO List',
 ApproverEmailAddress = gblCurrentUserEmail,
 Status = "Approved" || Status = "Rejected" || Status = "Approval Awaited",
 WeekStartDate > gblFinancialYearStart
 ),
 "EmpName",
 Employee.DisplayName,
 "TotalHours",
 TotalProjectHours + TotalNonProjectHours + TotalLeaveHours
 ),
 locSortColumn,
 If(
 locSortOrder = "ascending",
 SortOrder.Ascending,
 SortOrder.Descending
 )
 ),
 SortByColumns(
 AddColumns(
 Filter(
 'SPO List',
 WeekStartDate > gblFinancialYearStart,
 ApproverEmailAddress = gblCurrentUserEmail,
 (IsBlank(cmb_statusFilter_1.Selected.Value) && (Status = "Approved" || Status = "Rejected" || Status = "Approval Awaited")) || Status = cmb_statusFilter_1.Selected.Value,
 cmb_employee_filter.Selected.Mail = Blank() || EmailAddress = cmb_employee_filter.Selected.Mail,
 dte_weekstartFrom_1.SelectedDate= Blank() || WeekStartDate >= dte_weekstartFrom_1.SelectedDate,
 dte_weekstartTo_1.SelectedDate=Blank() || WeekStartDate <= dte_weekstartTo_1.SelectedDate
 ),
 "EmpName",
 Employee.DisplayName,
 "TotalHours",
 TotalProjectHours + TotalNonProjectHours + TotalLeaveHours
 ),
 locSortColumn,
 If(
 locSortOrder = "ascending",
 SortOrder.Ascending,
 SortOrder.Descending
 )
 )
)
,txt_search_1.Text, "EmpName")

 

 

I would like to know if I should expect any issues in the future with respect to delegation for the above code. Also, in many places it was mentioned Search is not delegable, but I did not receive any warning and this has been working fine in production (4800 items) so far. Could any one provide any insights if I've written a delegable code?

Thanks

Categories:
  • Verified answer
    Talha_Dar Profile Picture
    870 Super User 2024 Season 1 on at

    Hi @rbn_nue,

     

    If your filters consistently return fewer than 500 records each time, it won't cause an issue. You can also increase this limit to 2000, giving you more flexibility. However, if your dataset becomes large enough that your filters start returning over 2000 records, the filtering will only apply to the first 2000 records, potentially leading to unexpected behavior. In cases where extensive filtering is necessary, consider using Dataverse or SQL Server as data sources, as search functions are delegable in those contexts. For more information about delegation, please refer to the documentation provided below.

     

    https://learn.microsoft.com/en-us/power-apps/maker/canvas-apps/delegation-overview 

     

    If you found my answer helpful, please consider giving it a thumbs-up or a like. Your feedback is greatly appreciated!

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • rbn_nue Profile Picture
    on at

    Hi @Talha_Dar 

     

    Thanks for your response, I've set delegation limit to 2000 as of now. So what you're saying is as long my inner filter returns less than 2000 items, the search functionality will work fine?

  • Talha_Dar Profile Picture
    870 Super User 2024 Season 1 on at

    Yes

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard