Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

Gallery warning delegation - Power Apps

(2) ShareShare
ReportReport
Posted on by
: Hello Guys!
 
I have the following formula in a Power Apps gallery: 
 
SortByColumns(
    With(
        {
            prefiltro: Filter(
                InvestimentosRNV;
                (Prioridade.Value = ComboboxCanvas2_1.Selected.Value || IsBlank(ComboboxCanvas2_1.Selected.Value)) &&
                (Status.Value = "NÃO SUBMETIDO") &&
                (IsEmpty(ComboboxCanvas2.SelectedItems) ||
                    CountIf(
                        ComboboxCanvas2.SelectedItems;
                        Value in Exercicio.Value
                    ) > 0)
            )
        };
        Search(
            prefiltro;
            TextInputCanvas1_1.Value;
            Investimento
        )
    );
    "Orcamento";
    SortOrder.Descending
)
 

it has a delegation issue, although it is working. The only problem is that when I enter the screen where the gallery is, I always have to press a button to reset the filters for the items to appear in the gallery. Can someone help me remove the delegation issue?

The delegation problem is occurring in this part, as shown in the image below: 

&&

                (IsEmpty(ComboboxCanvas2.SelectedItems) ||
                    CountIf(
                        ComboboxCanvas2.SelectedItems;
                        Value in Exercicio.Value
                    ) >
 
  • Suggested answer
    Michael E. Gernaey Profile Picture
    40,272 Super User 2025 Season 1 on at
    Gallery warning delegation - Power Apps
    Hi
     
    Just to be clear, Delegation issues don't make them filters "fail", they make it so that your results are absolutely and positively going to be wrong the more data you have.
     
    It will "return" data, but sooner than later you will in fact not have correct data, so don't let yourself be fooled into thinking its just some simple or bleh thing.. its a big deal
     
    Now as to help you, Firstly, Count or any of its wanna be counterparts are not delegatable, unless its on something that is for sure and the code knows won't be over a delegation limit.
     
    Most likely you need to move your CountIf and IsEmpty
     
    I don't know many records you will get without those, But if you keep your With
    but then create an Inner With against the preFiltro result
     
    It should go away, fact is sometimes... and if you KNOW your list/table wont have more than 2000 rows you can just ignore it.. but that's how I would get rid of it.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard