web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery warning delega...
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
                    ) >
 
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,963 Moderator on at
    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

#2
11manish Profile Picture

11manish 193

#3
Valantis Profile Picture

Valantis 138

Last 30 days Overall leaderboard