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

Getting Delegable warning with StartsWith

Hi,

I have an application which uses Sharepoint list as its source, filter the gallery the with multiple columns my code is working but I am getting Delegable warning.

SortByColumns(
    Filter(
        [@Référence]; 
        StartsWith(Titre;TextInput1_4.Text) ||  //column 1
        StartsWith('Le client';TextInput1_4.Text) ||  //column 2
        StartsWith(Technologies;TextInput1_4.Text) &&  //column 3
            
(Services.Value=ComboBox1_13.Selected.Value || ComboBox1_13.Selected.Value=Blank())

&&

(Secteurs.Value=ComboBox1_12.Selected.Value || ComboBox1_12.Selected.Value=Blank())

);

    "Title";
    If(SortDescending1; Descending; Ascending))


I want to fix the delegable warning:


15 REPLIES 15
Prakash4691
Solution Specialist
Solution Specialist

@Nouhaila ,

 

Code looks fine. Could you try disable issearchable and check once.

@Nouhaila ,

You cannot "fix" a Delegation issue on a non-Delegable field type - it depends on the number of records in your list  - whether it is above your (500-2000) Delegation limit - as to whether the Filter will work fully. You might consider changing it back to Single Line of Text if you are never going to have more than 255 characters in it.

Also I took your code for the combo boxes (I assumed it was valid) - you just need the logic around the other way.

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.

 

 

Hi @WarrenBelz 
I'm new to PowerApps, can you please help me fix the logic, I am confused why there are not working.

When I use this code: 

SortByColumns(
    Filter(
        [@Référence]; 
        StartsWith(Titre;TextInput1_4.Text) &&
       // StartsWith('Le client';TextInput1_4.Text) ||  
       // StartsWith(Technologies;TextInput1_4.Text) || 
      //  StartsWith('le projet';TextInput1_4.Text)  &&  
  
(Services.Value=ServicesCmb.Selected.Value || ServicesCmb.Selected.Value=Blank())&&
(Secteurs.Value=SectersCmb.Selected.Value || SectersCmb.Selected.Value=Blank())
);
"Title";
    If(SortDescending1; Descending; Ascending))

I comment out 3 columns and then I filter it by combo boxes it's filtering it, but when I add more columns to be searched then the combo boxes stops working.

@Nouhaila ,

That is partly because if any element of the Filter is not Delegable, then the whole filter becomes not Delegable. I suspect you should be able to do all the filters except for Technologies. However you also need the or || filter items bracketed.

SortByColumns(
   Filter(
      [@Référence]; 
      (
         StartsWith(
            Titre;
            TextInput1_4.Text
         ) ||
         StartsWith(
            'Le client';
            TextInput1_4.Text
         ) 
      ) &&
      (
         ComboBox1_13.Selected.Value=Blank() ||
         Services.Value=ComboBox1_13.Selected.Value
      ) &&  
      (
         ComboBox1_12.Selected.Value=Blank() ||
         Secteurs.Value=ComboBox1_12.Selected.Value 
      )
   );
   "Title";
   If(
      SortDescending1; 
      Descending; 
      Ascending
   )
)

 

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 @WarrenBelz ,

The code worked, but why you wrapped the StartsWith columns into Brackets? why they were not wroking before even if I eliminate that column.

@Nouhaila ,

Always separate multiple and/or with proper bracketing to make clear exactly what you want - for instance the code

a=b && c=d || e=f

could mean

(a=b && c=d) || e=f

or

a=b && (c=d || e=f)

which are two different things.

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,780)