Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • knoxknnocks Profile Picture
    58 on at
    Re: LookUp & Filter Delegation Warnings

    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!

  • Lewkir Profile Picture
    on at
    Re: LookUp & Filter Delegation Warnings

    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.

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: LookUp & Filter Delegation Warnings

    @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
    Re: LookUp & Filter Delegation Warnings

    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,287 Super User 2024 Season 1 on at
    Re: LookUp & Filter Delegation Warnings

    @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
    Re: LookUp & Filter Delegation Warnings

    Hi,

     

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

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on at
    Re: LookUp & Filter Delegation Warnings

    @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.

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