I have a SharePoint list that has less than 50 items but will possibly grown more than 2000. I have a gallery (gallery5) that I want to Search. Here's the formula I have that give me a delegation warning.
The textbox name is "txtEventName" and the SharePoint column I'm searching is "Title" (single line of text)
Search('Job Inventory', txtEventName.Text, "Title")
"Title" is underline with a double blue line with the following message:
Delegation warning. The "Search" part of this formula might not work correctly on large data sets.
Any ideas on how to fix this?
Thanks!
Solved! Go to Solution.
The problem is that Search() is not a delegable function when used in SharePoint. There are two potential workarounds
1) Use Filter(datasource, StartsWith("Title", txtEventName.Text). Filter and StartsWith are delegable functions and will work with large lists. But they will only find records where the Title StartsWith what is in the text box. They won't find embedded words.
2) Use Filter() on some other field to pre-filter the list down to less than 2,000 items. Then Search() on those results. You'll still get the delegation warning, but you can ignore it because you know the filter will get you below the threshold. This has the advantage of being able to search for words within the "Title" field.
Search(Filter('Job Inventory',SomeOtherfield = value) txtEventName.Text, "Title")
The problem is that Search() is not a delegable function when used in SharePoint. There are two potential workarounds
1) Use Filter(datasource, StartsWith("Title", txtEventName.Text). Filter and StartsWith are delegable functions and will work with large lists. But they will only find records where the Title StartsWith what is in the text box. They won't find embedded words.
2) Use Filter() on some other field to pre-filter the list down to less than 2,000 items. Then Search() on those results. You'll still get the delegation warning, but you can ignore it because you know the filter will get you below the threshold. This has the advantage of being able to search for words within the "Title" field.
Search(Filter('Job Inventory',SomeOtherfield = value) txtEventName.Text, "Title")
Agreed with @Pstork1 on point 2, you have to find another condition to limit below 2000 the number the rows returned by the SharePoint server. The get rid of delegation error at this point 2, you can use:
With(
{FilteredDataBySharePoint:Filter('Job Inventory',SomeOtherfield = value)},
Search(FilteredDataBySharePoint, txtEventName.Text, "Title")
)
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
190 | |
57 | |
45 | |
36 | |
36 |
User | Count |
---|---|
270 | |
81 | |
78 | |
76 | |
70 |