cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Daniel_
Frequent Visitor

Delegation Issue - concatenate in lookup function

Hello.

 

I have a delegation issue, when having a compoite ID. The primary key is made up of "coloum_a, coloum_b" as a composite key on my SQL server.

 

In PowerApps, I need to lookup if a specific composite key is already existing, so I use both ID's from the app and combine them in concatenate(coloum_a, coloum_b) and get a delegation warning.

 

How can I avoid this delegation warning? 

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions

@Daniel_ 

Yes, if you want to avoid delegation issues and your datasource is over 2000 records and you cannot perform a delegable query to it, then you will need to gather all of the records in a local collection and filter/query against that.

The challenge will be how many records and what unique column can be used to "split" the delegable queries to the data source.

For example, if you have an autoincremented integer ID column in your datasource (I assume this is SQL) you can use that to cast multiple collections based on the ID (let's say they are all sequential) - 

Collect records where ID<2000, then records where ID>=2000 and <4000, etc.  There are many examples of this on this forum, so if you need some more specifics on it, search for them and if no luck...post back and we can continue to explore the options.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

6 REPLIES 6
RandyHayes
Super User III
Super User III

@Daniel_ 

Concatination and other various functions will cause delegation issues as you are seeing.  A quick workaround for this is to assign a variable with the concatenated value and then use that variable in your lookup.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hello.

 

I forgot to mention that I use a gallery, and I don't think a variable at each row will solve this problem.

 

- Daniel

@Daniel_ 

In this case, to avoid the delegation issue, you'll need to collect the information into a Collection and use that as the Gallery Items.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!


@RandyHayes wrote:

@Daniel_ 

In this case, to avoid the delegation issue, you'll need to collect the information into a Collection and use that as the Gallery Items.


I have the gallery items from a master data table, and patches the values into a record table.

 

So I assume I would have to collect all the records from the record table into a collection, and use that for lookup and avoid the delegation issue? If so, can you bring an example? 🙂

 

Thanks for your response,

 

Daniel

Hi @Daniel_ 

 

More information:

create-update-collection

 

Best Regards.

Yumia

@Daniel_ 

Yes, if you want to avoid delegation issues and your datasource is over 2000 records and you cannot perform a delegable query to it, then you will need to gather all of the records in a local collection and filter/query against that.

The challenge will be how many records and what unique column can be used to "split" the delegable queries to the data source.

For example, if you have an autoincremented integer ID column in your datasource (I assume this is SQL) you can use that to cast multiple collections based on the ID (let's say they are all sequential) - 

Collect records where ID<2000, then records where ID>=2000 and <4000, etc.  There are many examples of this on this forum, so if you need some more specifics on it, search for them and if no luck...post back and we can continue to explore the options.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,368)