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 / Question about Delegat...
Power Apps
Unanswered

Question about Delegation Warning using SQL.

(0) ShareShare
ReportReport
Posted on by 38

Hello,

 

For some context, I have a complex database in Microsoft SQL Server with a junction (or some say link) table because of a many-to-many relationship.

For example, I have a table called UseCases and a table called Drivers. This is a many-to-many relationship, with it looking like this.

mstrawn_0-1656341647294.png

My issue is when I want to display the drivers that are aligned to each use case. I have to do a nested filter, because I first need to get all the Driver_id's aligned with the specific UseCase_id from the junction table, and then filter those ID's in the Drivers table to actually show the name values.

 

My function is this on a dropdown (uc_id is passed into the screen where this takes place. It is the UseCase ID):
Filter(Drivers, key_id in Filter(DriversToUseCase,UseCase_id=uc_id).Driver_id)

 

However, I am getting a delegation warning on that "in" operator. Is there any advice to get around this? My junction table will likely go over 2000 records at some point, meaning I cannot just ignore the delegation warning. Also, again, I am using SQL server as my data source.

 

Thanks!

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @mstrawn 

    Would it be possible to create a SQL view to get around the limitation?

  • mstrawn Profile Picture
    38 on at

    I can try that. 
    Would it not still be the same issue as I will be basically saying:
    Filter(Drivers, key_id in viewname)

     

    Or would it work differently?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @mstrawn 

     I don't know much about Sql but can you produce a view that includes the filter?

  • mstrawn Profile Picture
    38 on at

    I did get a procedure to work, and it returns the values and I stored them as a collection using:
    ClearCollect(varDrivers,ViewDriversToUseCaseDrivers.Run(uc_id).ResultSets.Table1);

     

    When I hover over the collection, I see:

    mstrawn_0-1656348561768.png

     

    So it is getting the data right. However, I want those 3 rows to be the defaultselecteditems on my combobox. The combobox does have those entries as part of its data source. How can I populate the defaultselecteditems with whatever is stored in that collection?

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard