cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lewkir
Level: Powered On

LookUp & Filter Delegation Warnings

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,

6 REPLIES 6
Super User
Super User

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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Lewkir
Level: Powered On

Re: LookUp & Filter Delegation Warnings

Hi,

 

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

Super User
Super User

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

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Lewkir
Level: Powered On

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.

 

Super User
Super User

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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Lewkir
Level: Powered On

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.