Hello
I'm building a power app for my team to be able to pre book lab equipment for use.
I have a SP list with the following columns
Title - Asset ID - Single line of text
Start Date - Date and time
End Date - Date and time
Booked by - Person or group
Within the app I have a calendar view so the user can click on dates and see if equipment is already booked on those days in a gallery.
Then next to that there is a form when a user can select the dates and times they want to book items out for.
A TextInput populated by a variable for the asset ID selected
A start date picker called StartDateValue with hour and minute pickers called StartHourValue and StartMinValue
An end date picker called EndDateValue with hour and minute pickers called EndHourValue and EndMinValue
Then there is a confirmation button, on pressing the button I'd like the app to check if the SP list has the asset ID booked out on any of the selected dates, if it does, it notifies the user that the item is already booked at that time, if it doesn't it lets the user know the booking has been successful.

I've used this logic to make sure I capture any overlapping bookings.
When I run my app and make a booking, I'm getting both the error and succuss notifications and the bookings are being saved to my SP list even if there is a clash.
Any advice would be really helpful,
Thank you.
on select
If(
LookUp
('Asset Booking Calendar', Title = AssetID_TextInput.Text &&
((StartDateValue.SelectedDate +
Time(
Value(StartHourValue.Selected.Value),
Value(StartMinuteValue.Selected.Value),
0)
<= 'Start Date' )
&&
(EndDateValue.SelectedDate +
Time(
Value(EndHourValue.Selected.Value),
Value(EndMinuteValue.Selected.Value),
0)
>= 'End Date'))
||
((StartDateValue.SelectedDate +
Time(
Value(StartHourValue.Selected.Value),
Value(StartMinuteValue.Selected.Value),
0)
<= 'Start Date' )
&&
(EndDateValue.SelectedDate +
Time(
Value(EndHourValue.Selected.Value),
Value(EndMinuteValue.Selected.Value),
0)
>= 'Start Date'))
||
((StartDateValue.SelectedDate +
Time(
Value(StartHourValue.Selected.Value),
Value(StartMinuteValue.Selected.Value),
0)
<= 'End Date' )
&&
(EndDateValue.SelectedDate +
Time(
Value(EndHourValue.Selected.Value),
Value(EndMinuteValue.Selected.Value),
0)
>= 'End Date'))
||
((StartDateValue.SelectedDate +
Time(
Value(StartHourValue.Selected.Value),
Value(StartMinuteValue.Selected.Value),
0)
>= 'Start Date' )
&&
(EndDateValue.SelectedDate +
Time(
Value(EndHourValue.Selected.Value),
Value(EndMinuteValue.Selected.Value),
0)
<= 'End Date')));
Notify("This asset is already booked at this time",NotificationType.Error),
SubmitForm(Form1);
Notify("Your booking has been successfully made", NotificationType.Success);
NewForm(Form1)
);