cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Delegation Warning Filter Function

Hi,

 

I currently have a problem with a piece of code I used. It gives me a delegation warning, I'm trying to find a solution for it but without succces so far. The following piece of code can be found below. 

 

Filter(dif; Text(ID) = LookUp(PN_DIF_Status; Text(SelectedPN) = Partnumbers1.Value; DIF0.Value))

 

I found something on internet saying that you have to set a global variable and then using the Filter function. The code can be found below

 

Set(variable1,  LookUp(PN_DIF_Status; Text(SelectedPN) = Partnumbers1.Value; DIF0.Value))

Filter(dif, Text(ID)=variable1)

 

However, this also seems not the fix the problem. I still receive the delegation warning. FYI the tables 'DIF' and 'PN_DIF_Status' are both contains more than 10000+ rows

 

Anyone out there have a idea how to get rid of the delegation warning for the Filter function? Your help is much appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks @tommyvtran1 ,

I believe you need to go the other way to avoid the Delegation issue

With(
   {
      wDIFO:
         LookUp(
         PN_DIF_Status; 
         SelectedPN = Value(Partnumbers1.Value)
      ).DIF0.Value
   };
   Filter(
      dif;
      ID=wDIFO
   )
)

 NOTE - You cannot use a non-delegable query on 10,000 records. A numeric query is Delegable, so the With() statement should isolate the value you need for the filter.

 

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.

View solution in original post

7 REPLIES 7
Super User III
Super User III

Hi @tommyvtran1 ,

The 10,000 rows are not an issue if a delegable filter can isolate the value you need to lookup, so a similar concept using the With() statement may work for you.

With(
   {
      wDIFO:
         LookUp(
         PN_DIF_Status; 
         Text(SelectedPN) = Partnumbers1.Value
      ).DIF0.Value
   };
   Filter(
      dif;
      Text(ID)=wDIFO
   )
)

 

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.

Super User II
Super User II

Hi!

 

I think the issue here is two-fold, the first being that you are trying to convert a column to Text(), which means its trying to go through all records and convert them to text in order to perform the lookup, so that's immediately not delegable, then you are doing Something.Value as the comparative, when you should use a variable for this as you mentioned.

 

So, the OnChange for Partnumbers1 should be set to:

 

Set(ActualPartNumber, Value(Partnumbers1.Value));
Set(LookUpValue, LookUp(PN_DIF_Status; SelectedPN = ActualPartNumber; DIF0.Value) );

 

 

Then you can set your formula to this:

 

Filter(dif; ID = LookUpValue)

 

 

Could you try this and let me know how that goes for you?

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


How does this part of the code work, as 'Partnumbers1' is not recognized in this setting

Set(ActualPartNumber, Value(Partnumbers1.Value));

 

@tommyvtran1 ,

Is SelectedPN a Numeric or Text Value and how many items are in the list PN_DIF_Status ?

I assume PartNumbers is a Choice field?

 

Hi,

 

SelectedPN is a Numeric Value and PN_DIF_Status has 10 columns with 10000+ rows. "PartNumbers1" is the name of the column in the list "PN_DIF_Status".

 

Thanks @tommyvtran1 ,

I believe you need to go the other way to avoid the Delegation issue

With(
   {
      wDIFO:
         LookUp(
         PN_DIF_Status; 
         SelectedPN = Value(Partnumbers1.Value)
      ).DIF0.Value
   };
   Filter(
      dif;
      ID=wDIFO
   )
)

 NOTE - You cannot use a non-delegable query on 10,000 records. A numeric query is Delegable, so the With() statement should isolate the value you need for the filter.

 

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.

View solution in original post

Hi @tommyvtran1 ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (57,414)