web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to avoid delegatio...
Power Apps
Unanswered

How to avoid delegation warning using SQL DB as datasource

(0) ShareShare
ReportReport
Posted on by 14

I want to filter gallery based on selection made in another gallery.

Data Source is SQL Database. 

In Gallery2, I have selected ProductCategoryID's which don't have ParentProductCategoryID.

In another gallery I tried to use below function but I get delegation warning due to IN operator.

 

Filter(
 'SalesLT.Product';
 ProductCategoryID in Filter(
 'SalesLT.ProductCategory';
 ParentProductCategoryID = Gallery2.Selected.ProductCategoryID
 ).ProductCategoryID
)

 

 

 

SalesLT.Product table:

ProductIDProductCategoryID
5555
5565
6666
6676
7777
7787
8888
8898
9999
100010
100110
110011
110111
120012
120112

 

SalesLT.ProductCategory table:

ProductCategoryIDParentProductCategoryID
1NULL
2NULL
3NULL
4NULL
51
61
72
82
93
103
114
124
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,344 Most Valuable Professional on at

    Hi @kamil_k ,

    Firstly try this

    With(
     {
     _Data:
     Filter(
     'SalesLT.ProductCategory';
     ParentProductCategoryID = Gallery2.Selected.ProductCategoryID
     )
     },
     Filter(
     'SalesLT.Product';
     ProductCategoryID in _Data.ProductCategoryID
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • kamil_k Profile Picture
    14 on at

    Hi @WarrenBelz

    Thank you but unfortunately, I'm still getting this warning:

    kamil_k_0-1710081067280.png

     

  • WarrenBelz Profile Picture
    155,344 Most Valuable Professional on at

    @kamil_k ,

    My understanding is that the in operator is Delegable when querying a Text field in SQL. It appears that it does not like the pre-filter. Try setting a Variable to the first part and see if that works. If not, there is really no solution here,

     

  • kamil_k Profile Picture
    14 on at

    Thanks @WarrenBelz 

    Exactly, in operator is a problem here. I found an info that it's delegable to sql server but only partially

    https://learn.microsoft.com/en-us/connectors/sql/#power-apps-functions-and-operations-delegable-to-sql-server

     

    I solved my problem creating a view in SQL server where I joined additional column to the Product table so I can filter it with delegable functions only.

    Thank you for your time.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 883

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 477

Last 30 days Overall leaderboard