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,
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!
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.
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.
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.
@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
Hi,
Yeah I thought it might be that but even using = I get the same warning.
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.
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional