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.
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?
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?
Filter( 'dataverse table name', textInput1 in 'field1' || textInput1 in 'field2' );
Please help us to fix this issue.
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.
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.
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:
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?
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.
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.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.