Good evening hive mind,
I have a requirement to build an app to book desks for people that need to go to one of our hub offices.
The app is based on 2 lists in a SharePoint site 'Desks' (available desks to book) & 'Desk Reservations' (list of who has booked what desk and when).
The app functions as needed but the only issue I have left to resolve is from a delegation error I get when trying to filter the gallery of available desks for a certain date.
The gallery for the available desks will need to be filtered on 3 criteria:
1. A combo box that filters the directorate of where the desk is located (this is imported from the choices of column 'Directorate' in the 'Desks' SharePoint lists).
2. The 'Active' column (choice) in the 'Desks' SharePoint lists is set to Yes
3. The desk hasn't already been taken (pulls information from the 'Desk Reservations' list).
I currently have the filter working as follows but it seems to me you can't delegate using 'Not' and can't figure a way to switch it round to not use the 'Not' function:
SortByColumns(
Filter(
Desks,
Directorate.Value = cmbDirectorate.Selected.Value || If(IsBlank(cmbDirectorate.Selected.Value),
true,
false
),
Active.Value="Yes",
Not(
Title in Filter(
'Desk Reservations',
CheckOutFrom >= startTime && CheckOutTo <= endTime || CheckOutFrom <= endTime && CheckOutTo >= endTime
).DeskText
)
),
"Location",
Ascending
)
On app start I have:
ClearCollect(
colDirectorate,
Choices(Desks.Directorate)
);
ClearCollect(
colActive,
Choices(Desks.Active)
);
Variables are:
CheckOutFrom - Set when you pick a date before you get to the desk booking screen
CheckOutTo - Set when you pick a date before you get to the desk booking screen
Can anyone help me with how I can pull in information for part 3 of the requirements and not show desks that have already been booked? What I need is to replace the 'Not' part with something that does the same job but doesn't raise a delegation error.
On a side note:
At the end of the app there is a button to add to calendar which patches the information into the users calendar. Does anyone know of a way we can get the calendar entry ID or someway or recalling that calendar entry so it can be deleted at a later date if the desk is no longer needed and the booking is cancelled?
Thanks in advance,
Dave