cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AdrianAtEckoo
Helper I
Helper I

CDS Search field unreliable

Hi All

 

I have a gallery of customers which is about 10,000 rows, and a search field where a user simply searches for a customers surname.

In my recent testing I found that the searching is a bit unreliable, as some times the correct amount of records show up, sometimes a few less and sometimes none at all.

 

I don't quite understand whats going on. Is it because I need to let the data update as I'm searching? I also added a refresh signal just before it enters the search page, and I'll see how that goes.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @AdrianAtEckoo ,

Delegation limit of 2000 is powerapps limit.

To avoid the bad performance that you met, you should avoid this limit.

Or else you will always have this problem.

Search is non-delegate, filter is delegate.

I suggest you use Filter instead, which has the same feather of Search.

Please set your gallery items to this:

Filter([@DCustomers],CustomerSearch.Text in crc8b_surname)

But here's no problem:

you could only get result that surname is total equal to the text in CustomerSearch.

Because "in" is not delegate neither.

 

So I think the best way is to use collection, which does not has delegation limit.

You just need to set the app's OnStart:

ClearCollect(collection1,[@DCustomers])

Then use this collection as your data source in your app.

For example, set the gallery's Items:

 Search(collection1,CustomerSearch.Text,"crc8b_surname")

 

I suggest you know more about delegation:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
EricRegnier
Super User II
Super User II

Hi @AdrianAtEckoo,

It depends how you're searching since there are multiple ways to in CDS:
1) Entity search aka quick find which is the search text box on top of an entity list when you select the entity from the sitemap (left navigation. menu) 

2) Global Relevance search: https://docs.microsoft.com/en-us/power-platform/admin/configure-relevance-search-organization

3) Global Categorized Search aka multi-entity quick find : https://crmbook.powerobjects.com/basics/searching-and-navigation/searching-crm/#categorized_search

Which method are you using? If relevance search, it might be normal since there's latency for the data to be synced in Azure Search. Thanks

v-yutliu-msft
Community Support
Community Support

Hi @AdrianAtEckoo ,

Do you mean that you can not get right result by using Search function in CDS?
Do you have delegation warning?

I believe that you met delegation problem.

Your data is larger than 2000 and Search function is non-delegate.

 

Firstly, let me explain you something about delegation.

PowerApps could only deal with 2000 records at most in local, which is called delegation limit.

If your data source is larger than 2000, powerapps needs to delegate data source to deal with data.

But to delegate data source to deal with data, you need to meet two conditions: use delegate data source and only use delegate functions.

Delegation warning appears when you use delegate data source and not use delegate functions.

 

Secondly, how to solve your problems?

1)modify your formula to only use delegate functions

Could you show me your Search function? your field data type?

Here's a table about delegate functions in CDS:

Power Apps delegable functions and operations for the CDS for Apps

These Power Apps operations, for a given data type, may be delegated to the CDS for Apps for processing (rather than processing locally within Power Apps).

TABLE 5
Item Number [1] Text [2] Option Set DateTime [3] Guid
Filter Yes Yes Yes Yes Yes
Sort Yes Yes No Yes -
SortByColumns Yes Yes No Yes -
Lookup Yes Yes Yes Yes Yes
=, <> Yes Yes Yes Yes Yes
<, <=, >, >= Yes Yes No Yes -
And/Or/Not Yes Yes Yes Yes Yes
StartsWith - Yes - - -
IsBlank Yes [4] Yes [4] No [4] Yes [4] Yes
Sum, Min, Max, Avg Yes [5] - - No -

Here's a doc about this for your reference:

https://docs.microsoft.com/en-us/connectors/commondataservice/

 

2)save your data to collection

Then use collection as your data source in your app. In collection, you will not have delegation problem.

 

 

To sum up, you need to avoid the affect of delegation. Or else, your app will not perform good.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Drrickryp
Super User II
Super User II

Hi @AdrianAtEckoo 

Please post the items property of your gallery.

AdrianAtEckoo
Helper I
Helper I

@Drrickryp @v-yutliu-msft @EricRegnier 

I must be using the quick find search as I don't remember enabling any sort of relevance or categorized search within my canvas app.

 

In terms of delegation, would it be best to use the LookUp rather than the search function for the Gallery? Since Search doesn't appear in the table of delegable functions. I also don't understand how there can be a 2,000 row limit and yet it's showing me customer information that's further than the 2,000th row.

 

Heres my current code below.

Gallery Item > Search([@DCustomers],CustomerSearch.Text,"crc8b_surname")

Hi @AdrianAtEckoo ,

Delegation limit of 2000 is powerapps limit.

To avoid the bad performance that you met, you should avoid this limit.

Or else you will always have this problem.

Search is non-delegate, filter is delegate.

I suggest you use Filter instead, which has the same feather of Search.

Please set your gallery items to this:

Filter([@DCustomers],CustomerSearch.Text in crc8b_surname)

But here's no problem:

you could only get result that surname is total equal to the text in CustomerSearch.

Because "in" is not delegate neither.

 

So I think the best way is to use collection, which does not has delegation limit.

You just need to set the app's OnStart:

ClearCollect(collection1,[@DCustomers])

Then use this collection as your data source in your app.

For example, set the gallery's Items:

 Search(collection1,CustomerSearch.Text,"crc8b_surname")

 

I suggest you know more about delegation:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/delegation-overview

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (3,404)