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 Platform Community / Forums / Power Apps / LookUp & Filter Delega...
Power Apps
Unanswered

LookUp & Filter Delegation Warnings

(0) ShareShare
ReportReport
Posted on by

Hi running into more delegation issues I'm afriad.

 

The Following code throws a delegation warning:

 

Filter(
 RoomList, 
 LookUp(
 'Booking List',
 'Room Number' = Title,
 'Room Number'
 )
 <> Title
)

Here I am fIltering one list by the results of a lookup in another.

 

Both columns are text columns so I thought it might be the "<>" but even with an = I still get the same warning.

 

The blue line is under the LookUp part of the formula but it says the Filter part isn't delegatable.

 

I thought I had fathomed delegation but apparently not.

 

Can anyone advise?

 

Cheers,

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Lewkir 

    Strings in SharePoint (I assume you're using SP) are not delegable except for "=".

    Take a look at the connector reference for operators and formulas that are.

    Your issue comes from the <> part where you are trying to use that operator on two strings...not delegable.

     

    Hope that sheds some light.

  • Lewkir Profile Picture
    on at

    Hi,

     

    Yeah I thought it might be that but even using = I get the same warning.

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Lewkir  I believe it is the Lookup in your filter that is the issue here then if you used equals as well.

     

    Try separating out the Lookup:

    UpdateContext({lookupTitle:Lookup('Booking List', 'Room Number' = Title, 'Room Number') //somewhere you have this
    Filter(RoomList, Title=lookupTitle) // no delegation warning

     

  • Lewkir Profile Picture
    on at

    Hmm realised I wasn't as clear as I should ahve been at first.

     

    So the Title field is actually from another list, RoomList.

     

    I tried to simplify things to make them easier to read but removed too much.

    Full code is:

    Filter(
     RoomList, //Main list to be filtered
     locationDrop.Selected.Value = Location,
     RoomTypeDrop.Selected.Value = 'Room Group', //Drop downs at the side
     
     LookUp(
     Filter(
     'Booking List', // 
     FromCalcFlow >= Value(FromDateAsNumber.Text) && // Filters booking list where booking dates are within chosen dates on drpdowns
     FromCalcFlow < Value(ToDateAsNumber.Text) Or 
     ToCalcFlow > Value(FromDateAsNumber.Text) && 
     ToCalcFlow <= Value(ToDateAsNumber.Text)
     ),
     'Room Number' = RoomList[@Title], 
     'Room Number'
     )
     <> Title // this is supposed to ensure the result removes rooms which are booked within those times.
    )

    The blue line underlines the Lookup part of the code but the warning says the filter wont work.

     

    The inner filter shows no errors when on it's own, however.

     

    Hopefully this isn't too hard to read.

     

    This is in the items field of a gallery.

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Lewkir 

    I'm not getting the time now to fully digest your formula, but I believe there is a flaw in the logic you have for that lookup.

    You are Looking Up a record in a Filtered List of "Bookings" that match a date criteria.  So, Filter is going to return 0 to X records. That is your datasource for the Lookup.  Then you are (with a Lookup) going to return the first record that matches the Lookup (room number=room number/title).

    Although this might work in some ways - I believe the logic could be changed.

    In this case, it really begs for the In operator...which of course brings us back to delegation issues.

     

    I'm going to have to wrap my head around it a little more later when I have some time, but these are my initial thoughts.

     

  • Lewkir Profile Picture
    on at

    So I'm filtering the list of bookings to show which rooms are booked in a selected timeframe.

     

    The lookup then tries to find a particular room title (from the parent gallery) in this filtered list so it shouldn't matter if it only finds the first one as the fact there is one in the timeframe means the timeframe cannot be used. (and must be altered)

     

    The outer filter then removes the rooms which the lookup found from the displayed list meaning that only rooms with no booking in the timeframe can be booked.

     

    my worry is that if there are a lot of bookings within a time frame then they won't be shown and thus will be double booked. (I imagine this would only be an issue if someone attemted to book a room for a full day)

     

    I just can't work out why the lookup is shwoing a delegation warning when I'm only checking if a string=a string.

     

    The outer filter doesn't really matter as it is filtering the room list which will never come close to 2000 items.

  • knoxknnocks Profile Picture
    58 on at

    I know this is from a long time ago, but why is it that a LookUp (that will result in a text string) within a Filter result in a delegation warning if it's just comparing string=string? Eg

    Filter(employeeList1, Name = LookUp(employeeList2, employeeID="S1234", Name) )

    The delegation warning blue underlines are on the LookUp part. The datasources are Sharepoint Lists. Thanks!

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard