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 / Power Apps Delegation ...
Power Apps
Answered

Power Apps Delegation Warning for SharePoint List issues with known features

(0) ShareShare
ReportReport
Posted on by 10

Hi there,

 

can someone please explain to me, why is this not being delegated correctly to SharePoint list by Power Platform? I don't want to go on a rant here, but I am starting to get extremely frustrated by power apps after 4 years of development. This piece of code worked  and suddenly after year it does not. I have no idea why. I read everything on delegation, I asked chatGPT but for the love of god, I cannot figure out, why it does not work all of the sudden. All I want to to do is:

if a user selects a value from a status dropdown, filter my text field with that value, otherwise show all rows + filter by startswith. that's it. why is suddenly this causing an issues? 

 

frustrationpwas_1-1677932897412.png

 

 

Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @frustrationpwas 

    What type of column is Status?  Depending on the answer, this may work:

    With({_items:Filter(zmluvySchvalovania, dd_status_filter_1.Selected.InternalName= "ALL"|| 
     Status = dd_status_filter_1.InternalName.Value,
     IsBlank(txtfilter1.Text)||
     StartsWith(Title, txtfilter1.Text)
     )
     },
     SortByColumns(
     _items, "Created",
     If(dd_status_filter_created_1.Selected.Value= 'Najnovsie","Descending","Ascending
     )
    )
     
  • frustrationpwas Profile Picture
    10 on at

    thank you. Status is simple text column, because I was counting on filter it + I also set it to be an indexed column. 

    I like the approach. I tried to do the same, but my issue is that if "

    dd_status_filter_1.Selected.InternalName = "All"

    I don't want to filter by "Status" column, otherwise I want to filter by "dd_status_filter_1.Selected.InternalName". I just don't understand why I cannot use IF condition inside filter


     

  • frustrationpwas Profile Picture
    10 on at

    I was able to fix my filter and I have to say, Power Apps is the stupidest piece of tech I had a chance to work with. It starts to boil my blood when I see all these Microsoft execs saying how low code is great. Look at the first snipped of code (issues with delegation) vs second piece of code. Ok, I get it, delegation is not supported if I use ID > 0 but still, even without it, it did not work and I had to rewrite it into that monstrosity below. My requirements were simple:

    1. if you are an admin, I will show you all records, otherwise I will show you records only for a signed in user
    2. if status dropdown is selected, I will filter by text column in SPO otherwise, I will not filter by it

     

    Microsoft people should be paying us for being forced with such a mediocre tech

     

    From this

    SortByColumns(
     Filter(
     ZmluvySchvalovania,
     //filter only records for the current user
     If(
     var_admin,ID > 0,ThisRecord.Gestor.Email = User().Email || ThisRecord.GestorDabler.Email = User().Email
     ), 
     //filter records based on status
     If(
     dd_status_filter_1.Selected.InternalName = "All",ID > 0,ThisRecord.Status = Value(dd_status_filter_1.Selected.InternalName) 
     ),
     If(
     IsBlank(txt_filter_1.Text), ID > 0, txt_filter_1.Text in Title 
     ) // filter recored based on text search 
     ),
     "Created",
     If(dd_status_filter_created_1.Selected.Value = "Najnovšie","Descending","Ascending") 
    )
    

     

    To This

    With(
     {
     _items:
    
     If(
     var_admin && dd_status_filter_1.Selected.Value <> 0,
    
     //if admin and STATUS filter ON
     Filter(
     ZmluvySchvalovania,
     ThisRecord.Status = dd_status_filter_1.Selected.Value,
     IsBlank(txt_filter_1.Text) || StartsWith(Title,txt_filter_1.Text)
     )
     ,
    
     //if admin and no filter
     If(
     var_admin && dd_status_filter_1.Selected.Value = 0,
     Filter(
     ZmluvySchvalovania,
     IsBlank(txt_filter_1.Text) || StartsWith(Title,txt_filter_1.Text)
     )
    
     ,
    
     //if NOT admin and STATUS filter ON
     !var_admin && dd_status_filter_1.Selected.Value <> 0,
     Filter(
     ZmluvySchvalovania,
     ThisRecord.Status = dd_status_filter_1.Selected.Value,
     IsBlank(txt_filter_1.Text) || StartsWith(Title,txt_filter_1.Text),
     ThisRecord.Gestor.Email = User().Email || ThisRecord.GestorDabler.Email = User().Email
     )
     ,
     //if NOT admin and STATUS filter OFF 
     Filter(
     ZmluvySchvalovania, 
     IsBlank(txt_filter_1.Text) || StartsWith(Title,txt_filter_1.Text),
     ThisRecord.Gestor.Email = User().Email || ThisRecord.GestorDabler.Email = User().Email
     ) 
     
     )
     
     
     )
    
     },
     SortByColumns(
     _items, 
     "Created",
     If(dd_status_filter_created_1.Selected.Value = "Najnovšie","Descending","Ascending") 
     )
    )

     

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @frustrationpwas 

    IMHO: Making it a bit more clear. 

    With({condition1: var_admin && dd_status_filter_1.Selected.Value <> 0,
     condition2: var_admin && dd_status_filter_1.Selected.Value = 0,
     condition3: !var_admin && dd_status_filter_1.Selected.Value <> 0,
     result1: Filter(
     ZmluvySchvalovania,
     ThisRecord.Status = dd_status_filter_1.Selected.Value,
     IsBlank(txt_filter_1.Text) || StartsWith(Title,txt_filter_1.Text)
     ),
     result2:Filter(
     ZmluvySchvalovania,
     IsBlank(txt_filter_1.Text) || StartsWith(Title,txt_filter_1.Text),
     result3:Filter(
     ZmluvySchvalovania, 
     IsBlank(txt_filter_1.Text) || StartsWith(Title,txt_filter_1.Text),
     ThisRecord.Gestor.Email = User().Email || ThisRecord.GestorDabler.Email = 
     User().Email)
     },
     
     SortByColumns(
     If(condition1,result1, condition2, result2, condition3, result3),"Created"),
     If(dd_status_filter_created_1.Selected.Value = "Najnovšie","Descending","Ascending") 
     )
    )

     

  • frustrationpwas Profile Picture
    10 on at

    that is a neat idea. thank you. it's very very far from my ideal implementation due to power apps horrendous filter function implementation, but at least this works. thank you very much for your help @Drrickryp .

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @frustrationpwas

    FYI, One of the reasons why I write my code that way is to avoid an If() inside a filter.  If() inside a filter is not delegable.

    raining.gif

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard