Showing results for 
Search instead for 
Did you mean: 
Advocate I
Advocate I

Filter() delegation to SQL doesn't work properly



When I use following syntax it gives me NO warning:



When I use  following syntax it GIVES me a warrning and delegation is not working properly (not all rows are returned)

ClearCollect(collection,Filter('[dbo].[PA_VIEW_VW]',USER_EMAIL in otherCollection.emails));

This is not inline in  the article that Filter() function CAN be delegated.

IS there any workaround to check for more than 1 value? The number of records in


 is non deterministic - it can be 1 or 10.




Community Support
Community Support

Hi @KML,


The supported scenario for the in operator in SQL Server should be used as below, the right side of the in operator should be a column from the SQL Table:


Filter(DataBaseTable, "String" in Column)

Put the Column at the left side of the in operator is currently supported:

Filter(SQLTable, Column in [Values])

You may consider hold the SQL Table into a local collection, then do the filter as needed.




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

Hi @v-micsh-msft


Unfortunately your answer is misleading for me - you present 2 examples with different approach and I'm confused which one is correct or when I should utilize in which moment.


Let me once again put examples with errors as above examples doesn't work for me.


ClearCollect(usrCustCat,Filter('[dbo].[PA_UserScope_VW]',USER_EMAIL in otherCollection.emails))
//Part of this formula cannot be evaluated remotely. Right side of "in" operator is not a column name.

ClearCollect(usrCustCat,Filter('[dbo].[PA_UserScope_VW]',otherCollection.emails in USER_EMAIL))
//2 errors
//otherCollection.emails - Invalid argument type. Cannot use Table values in this context/
//Delegation warning. This part "Filter" of this formula might not work correctly on large data sets. The data source might not be able to process the formula and might return an incomplete data set. Your application might not return correct results or behave correctly if the data set is incomplete.


Please note that I'm using on-premises gateway.





EDIT: I can't store '[dbo].[PA_UserScope_VW]' in a local collection as it has over 6000 rows.



Hope the confusion gets clarified whether SQL supports delegable operator for IN or not. Can you please update the documentation with the good set of examples of how it works. 


Lots of forum answers/replies are misleading.


Will follow this post and watch for a solution by someone.







Please test on "On-premises data gateway" not on Azure.




Frequent Visitor

Hi All,

I developed a simple application and publish it. When i opened that app through my phone, I noticed that it has already a login page. So i thought , I would take those loginid and show data in the screen on the basis of loginid.

I am not Dynamics365 DataSource.


For this I used filter and Set currentuser details in the OnStart of the Screen1[Set(e,User())] and in the Screen1 I am using a Blank Vertical Gallery and I have written in the Items property [Filter(CustomerDeliveryStatusDatas_1,UserId=e.Email)]



I have the exact same issue. "CaseStatus" is a text column in the datasource.


Filter('[dbo].[Cases]',ComboBox1.SelectedItems.Value in CaseStatus && QueuePicker.Selected.QueueID = QueueID)

This line gives me the error "Cannot use table values in this context". If i swap the the column and the combo...


Filter('[dbo].[Cases]',CaseStatus in ComboBox1.SelectedItems.Value && QueuePicker.Selected.QueueID = QueueID)

...everything works as expected but i get the delegation warning.


If i change the combobox to a dropdown (or set "SelectMultiple" to false) everything works with delegation to SQL, so the problems is "in" but only in some cases.


Is this considered to be a bug or is it by design?

Not applicable

adding in someone to review. 



Any feedback on this review yet?


I'm having similar issues.

So here's my three filters ...

IGUID in '[dbo].[Q2_IA_UP_TGT]'.IGUID

'[dbo].[Q2_IA_UP_TGT]'.IGUID in IGUID



First gives delegation blue underline, second give table type red underline, and third works ok because it's "=" not "in".


Also, this is using Azure SQL, not DMG, so the issue seems to be the generic across both.

Helpful resources

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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