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

Is a filter function partial deligatble?

Hi, I allready asked a question related to the topic deligation here: same topic 

Now I have one more question to the same topic:

In this case the user can filter a database by a simple dropdownmenu. The implementaion allow the app to deligate that filter function to the database.

If(Dropdown_Bereich_4.Selected.Bereichbezeichnung <> "Alle";Filter(DatabaseAddOnTool_AddOnPlaetze;Bereichbezeichnung = Dropdown_Bereich_4.Selected.Bereichbezeichnung);DatabaseAddOnTool_AddOnPlaetze)

That is fine working, no warinings related to deligation, so far.

Now I want the user to be able to search this filtered data for a containing string.

So I add a TextInput component and implement it in the items property of the gallary component, like this:

If(Dropdown_Bereich_4.Selected.Bereichbezeichnung <> "Alle";Filter(DatabaseAddOnTool_AddOnPlaetze;Bereichbezeichnung = Dropdown_Bereich_4.Selected.Bereichbezeichnung;TextSuche_2.Text in ARTNAME_UNICODE);Filter(DatabaseAddOnTool_AddOnPlaetze;TextSuche_2.Text in ARTNAME_UNICODE))

Now I get a deligation warning.

My question is, does this deligation issue also affect the first filter function? And if this is the case, is there a solution wich dont couse a deligation warning?

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @NeoLexx , 

The issue is the in filter, which is not Delegable. You can do this and not get a warning

With(
   {
      wList:
      Filter(
         DatabaseAddOnTool_AddOnPlaetze;
         Dropdown_Bereich_4.Selected.Bereichbezeichnung= "Alle" ||
         Bereichbezeichnung = Dropdown_Bereich_4.Selected.Bereichbezeichnung
      )
   };
   Filter(
      wList;
      TextSuche_2.Text in ARTNAME_UNICODE
   )
)

BUT the top filter will only return record numbers up to your Delegation limit for the bottom filter to execute. I have a blog on Delegation that may be useful to you.

 

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.

Visit my blog Practical Power Apps

 

 

View solution in original post

5 REPLIES 5
WarrenBelz
Super User
Super User

Hi @NeoLexx , 

The issue is the in filter, which is not Delegable. You can do this and not get a warning

With(
   {
      wList:
      Filter(
         DatabaseAddOnTool_AddOnPlaetze;
         Dropdown_Bereich_4.Selected.Bereichbezeichnung= "Alle" ||
         Bereichbezeichnung = Dropdown_Bereich_4.Selected.Bereichbezeichnung
      )
   };
   Filter(
      wList;
      TextSuche_2.Text in ARTNAME_UNICODE
   )
)

BUT the top filter will only return record numbers up to your Delegation limit for the bottom filter to execute. I have a blog on Delegation that may be useful to you.

 

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.

Visit my blog Practical Power Apps

 

 

So just for my understanding. When I use your method, the deligation warning goes away but I still have the deligation issue?

 

My dataset contains more than 2000 entities, it is important that my first filter associated with the dropdown menu filters through all entities. The second filter needs to filter less than 2000 entities.

@NeoLexx ,

That is why I gave you the BUT in my post. The in filter is simply not Delegable - if StartsWith (which is Delegable) is sufficient

Filter(
   DatabaseAddOnTool_AddOnPlaetze;
   (   Dropdown_Bereich_4.Selected.Bereichbezeichnung= "Alle" ||
       Bereichbezeichnung = Dropdown_Bereich_4.Selected.Bereichbezeichnung
   ) &&
   StartsWith(
      ARTNAME_UNICODE,
      TextSuche_2.Text
   )
)

 

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.

Visit my blog Practical Power Apps

 

NeoLexx
Frequent Visitor

Thx for the help. After reading your blogs, espescily that one that is referring to the with() Statement, i get what i was looking for.

 

With(
   {
      wList:
      Filter(
         DatabaseAddOnTool_AddOnPlaetze;
         Dropdown_Bereich_4.Selected.Bereichbezeichnung= "Alle" ||
         Bereichbezeichnung = Dropdown_Bereich_4.Selected.Bereichbezeichnung
      )
   };
   Filter(
      wList;
      TextSuche_2.Text in ARTNAME_UNICODE
   )
)

The first part of this function is the delegation to Sharepoint so that the entire dataset is filtered. The result is stored in the wList variable, with the maximum number of entries limited to 2000, which is okay because I don't expect to have more than 20000 entries after the filtering process.

 

In the next step, the entries of the wList variable are filtered and since by definition there can be no more than 2000 entries, the "in text filtering" no longer issues a deligation warning.

Hi @NeoLexx ,

Yes - as I mentioned the With() filter will only return records up to your Delegation limit - it can filter any number of records, it is only the result that is limited.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,677)