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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Answered

Delegation Issues

(4) ShareShare
ReportReport
Posted on by 822 Super User 2025 Season 2
In all of my experience I've never dealt with delegation issues with prod apps not until now where the list items are now over 2000 

I know that there are already a lot of posts about this but I can't seem to understand so I'm trying an individual post that is catered to my current formula 
the delegation warning lies on the in and || of my formula
 
Search(
    Filter(
        datasource,
        Status.Value = Status_Controll.Selected.Value || Status_Controll.Selected.Value = Blank(),
        Status_Controll_1.Selected.Value in Concat('Product',Value&",")|| Status_Controll_1.Selected.Value = Blank(),
        'GL'.Value = Status_Controll_2.Selected.Value || Status_Controll_2.Selected.Value = Blank(),
        If(Toggle1.Value,('Reminder Date 1' <= (DateAdd(Now(),Slider1.Value))),!(Toggle1.Value)),
        If(Toggle1.Value,('Reminder Date 1' >= (Now())),!(Toggle1.Value))
    ),
    TextSearchBox1_1.Text,
    
    Title,
    'OCR (Native_Lang)'
)

Another problem that I encounter with this formula is that the gallery loading takes too long to load. If you have any advise on dealing with large datasource it would be highly appreciated since its my first time dealing with large data. 

Thank you! 



 
Categories:
I have the same question (0)
  • w.p Profile Picture
    8,339 Super User 2025 Season 2 on at

    Reza Dorrani: DELEGATION in Power Apps | Must Know to build efficient Apps
    https://www.youtube.com/watch?v=2cKcylsGlPg
     


     
  • Verified answer
    AmínAA Profile Picture
    1,228 Super User 2025 Season 2 on at
    Greetings @KevinGador!
     
    The main problem I’m seeing with your code is that you’re using several non-delegable functions that, to my knowledge, don’t work in any data source. Bear in mind that different data sources have different limitations. You can find those in here: Query limitations: Delegation and query limits
     
    Where you can find the following links to the different data sources you may be using:
     
    The specifically nondelegable functions listed are:
    • FirstN, Last, LastN
    • Choices
    • Concat
    • Collect, ClearCollect
    • GroupBy, Ungroup
     
    So, for your code to work, as you can imagine, you would need to avoid using non-delegable functions, perhaps changing those for variables where you previously transformed your data however you needed to make it work properly.
     
    Now, regarding the gallery taking to long to load, it’s normal the more data you have… Usually, when you have delegation, you will be loading records in batches when you need it, meaning that it doesn’t really take long… So, solving your delegation problems should also solve your collection problems.

    If you like my response, please give it a Thumbs Up. Should this reply solve your question, please mark your post as Solved. Otherwise, feel free to reply to my answer for further help.
    Connect with me if you feel like it! 
     
  • Verified answer
    stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Regarding your code, the performance thing: (After you play with StartsWith rather than Contact from @AmínAA and @w.p suggestion)
    • Pick the Now() and DateAdd(Now(),Slider1.Value) out. otherwise you have to calculate for each record.
    • Use With.
    • Use one filter would be enough.
    the structure will be like:
    With(
        {
            varNow: Now(),
            varUpper: DateAdd(Now(), Slider1.Value, Days)   /* or Minutes/Hours—match your unit */
        },
        Filter(
            datasource,
    
            /*  Status filter */
            
    
            /*  Product filter */
            
    
            /*  GL filter */
            
            /*  Reminder-date window (only if toggle on) */
           
    
            /* Text search (delegable!) */
            
        )
    )
    
    If you don't use hour and mins, use Today() instead.
     
    Good Luck.
     
  • ronaldwalcott Profile Picture
    3,847 Super User 2025 Season 2 on at
    Handling large data sources is a matter of design. Consider what functionality you are trying to provide and then try to establish how you can search your data in a delegable manner. Sometimes you may need to restructure your data for performance increases.
  • AmínAA Profile Picture
    1,228 Super User 2025 Season 2 on at
    Hi there @KevinGador!
     
    Checking in on you out since I've finally got power back! (I'm in Spain, so Power Outage had me offline against my will XD).
     
    Hopefully, with @stampcoin's code structure, which I love, and my reply on delegation functions your problem should've been cleared by now, but just in case, I wanted to know if you needed any further help or explanation!
  • Verified answer
    WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at
    Adding a bit more content to @stampcoin's structure, you need to keep all your calculations out of the filter
    With(
       {
          _Rem1:
          DateAdd(
             Today(),
             Slider1.Value
          )
       },
       Search(
          Filter(
             datasource,
             Status.Value = Status_Controll.Selected.Value || Status_Controll.Selected.Value = Blank(),
             Status_Controll_1.Selected.Value in 'Product'.Value || Status_Controll_1.Selected.Value = Blank(),
             'GL'.Value = Status_Controll_2.Selected.Value || Status_Controll_2.Selected.Value = Blank(),   
             !Toggle1.Value || 
             ('Reminder Date 1' <= _Rem1 && 'Reminder Date 1' >= Today())
          ),
          TextSearchBox1_1.Text,
          Title,
          'OCR (Native_Lang)'
       )
    )
     
    Please click Does this answer your question 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 a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • Michael E. Gernaey Profile Picture
    53,452 Super User 2025 Season 2 on at
     
    You've been given plenty of good ideas already, but I want to talk about how you think about design, especially as it relates to the data model.
     
    1) you can already see that some datasources don't support delegation at all. This mean you either always have less than 2000 records in the back end AND you updated the default delegation from 500 to 2000.
     
    2) validate that you aren't creating unnecessarily large mutli-complex filters. Sure its easy to just keep Anding or ||ing them together and it works, but does working for you mean its closer to optimal, or simply that it grabs the correct data.
     
    Most people are the later. They just want the query to run and give data and be done.
     
    3) What exactly is your data, Transactional? Analytical? Business process mixture? etc.
    How you build your data model, impacts the app more than anything else because sometimes it makes sense to normalize it all and other times to denormalize it, and do you purposely duplicate data, use lookups, references etc etc.
     
    in most instances, people are only thinking about make it work, not making it (as a pattern) optimal.
     
    4) did you remember to turn on delegation support for certain back end datasources and functions(expressions).
     
    In the end, we will almost always be able to tell you how to get rid of the delegation issue, but the real question is, is the data model really what it should be, versus 2 off fixes (which sometimes... won't come easy)
     
    Cheers,
  • KevinGador Profile Picture
    822 Super User 2025 Season 2 on at
    Hi thanks everyone that have contributed to this post! 

    I was a little busy with work and havent fully read everything here yet! 

    I appreciate all the advise and will try to understand each and every replies 

    for the answer I will soon chose the one that helped me clearly and concise. Its hard to choose 
  • AmínAA Profile Picture
    1,228 Super User 2025 Season 2 on at
    Hi there @KevinGador!
     
    You don't have to choose just one answer. If you feel like several replies do help out, you can mark those. The point is that others that come to this post, get one or several answers on how to solve the problem, besides helping you out of course!
     
    Bear in mind that some times, people reply to add something to previous replies. So, if you feel like there's a clear best answer, then it's easy, but otherwise, feel free to mark any and all truly helpful replies!
  • KevinGador Profile Picture
    822 Super User 2025 Season 2 on at
    Hi @ 

    it appears that the formula
    Status_Controll_1.Selected.Value in 'Product'.Value || Status_Controll_1.Selected.Value = Blank()
     
    is non delegable because of the keyword "in"

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard