HI @Kbostwick
You can handle this by checking for overlaps before saving the reservation. The key is to only compare against bookings in the same workspace. When a user selects a workspace, start date, and end date:
1. Look at your reservations table and filter for records where: > The workspace matches the one just selected. > The new date range overlaps with an existing one.
2. If you find a match, show an error message like: > “This workspace is already booked for that time.”
3. If there’s no conflict, go ahead and save the booking.
That way:
Two people can book different workspaces at the same time > But no one can double-book the same workspace
This check can be done with a simple formula on your save button.
Sample Formula > On save Button On select Property
If(
CountRows(
Filter(
Reservations,
Workspace = dd_Workspace.Selected.Result &&
(
(DatePickerStart.SelectedDate <= EndDate && DatePickerEnd.SelectedDate >= StartDate)
)
)
) > 0,
Notify("This workspace is already booked during the selected time. Please choose a different slot.", NotificationType.Error),
// Else: proceed to save
Patch(Reservations, Defaults(Reservations), {
Workspace: dd_Workspace.Selected.Result,
StartDate: DatePickerStart.SelectedDate,
EndDate: DatePickerEnd.SelectedDate
})
)