cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ancy
Kudo Kingpin
Kudo Kingpin

Power Apps Delegation issue in Canvas App

Hi,

 

We need help to resolve delegation issue in Canvas App/Power Apps.

 

We are using the Dataverse as a connector and wanted to get 2000+ data from Dataverse. When we are using the Dataverse table directly on Filter query on Gallery, it's showing delegation warning as I am using Search feature. We have used search box (Input Box) control at top of the gallery and wanted to filter gallery data based on Search text. 

 

While comparing input box with Dataverse field into Filter query, it's showing delegation warning for "in" operator. Also, query is applying only on the 2000 records of Dataverse and not showing accurate data from Dataverse. Please help us to fix this issue.

 

Any help will be appreciated.

 

Thank you

7 REPLIES 7
BCLS776
Super User
Super User

The "in" operator itself is not delegable, but often there is a way to restructure your query to avoid the problem. Can you share your gallery Items code so we can help you re-write it?

 

Bryan

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Ancy
Kudo Kingpin
Kudo Kingpin

Hi @BCLS776,

 

Thanks for providing support.

 

We are filtering dataverse table based on the search box value (i.e. inputBox1) into Dataverse fields. When we enter text in search box, it will filter gallery based on searched text. This query works well if we have less than 2000 records, but when we have 2000+ records in the table, then result/data is not accurate.

 

Is there any way to get rid of the "in" operator in place of the below query? OR is there any alternative to fix this issue?

 

Example Code:

Filter(
'dataverse table name',
textInput1 in 'field1' || textInput1 in 'field2'
);

 

Please help us to fix this issue.

 

Thank you

BCLS776
Super User
Super User

Are 'field1' and 'field2' of a complex data type that prevents you from using the "=" operator? The more you can share about the schema, the more quickly we can resolve your issue. Also, please make sure textInput1 is not only a control name, but a full reference to the value contained by it. In other words, it usually has ".Text" at the end of it.

 

Bryan

 

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Ancy
Kudo Kingpin
Kudo Kingpin

Thanks for the quick response @BCLS776,

 

The field1 is of Lookup type and field2 is type of string. Instead of "=" we are using "in" operator because, we wanted to check if "field1.Name contain textInput1.Text" OR "field2 contain textInput1.Text" then show records from dataverse. As per our understanding, "=" operator will match exact string in the textInput1.Text with field1 and field2. 

 

Please advise.

 

Thank you

I played with your scenario a bit today and could get one of the two 'in' operators to delegate, as long as this preview setting is turned on:

BCLS776_0-1634316592590.png

However, it won't do it for a second 'in' behind an Or condition. StartsWith is a delegable operation - any chance your business need can work with that instead of one of those 'in' operators?

 

_________________________________________________________________________________________
Help the community help more users by choosing to "Accept as Solution" if this post met your needs. If you liked the post and want to show some appreciation, please give it a Thumbs Up.
Ancy
Kudo Kingpin
Kudo Kingpin

Thanks for the help @BCLS776,

 

I will check for "StartsWith" and if we can replace "In" operator. Thanks for providing helpful suggestions. That would be great if you could provide any other alternatives to fix the issue if you have. Thanks for providing helpful suggestion.  

 

Any help will be appreciated.

 

Thank you

poweractivate
Community Champion
Community Champion

@Ancy 

 

Consider to place the logic

 

textInput1 in 'field1' || textInput1 in 'field2'

 

and instead use a Dataverse View that is already pre filtered by some logic similar to this.

Then, let's say, it is a Gallery in Canvas App,  you should be able to filter by the Dataverse view directly.

 

You can check if this can be a possible approach as well for your case.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,207)