Hey.
I have a form. In that I am selecting a particular individual. Then I have 2 date pickers. StartTime and EndTime.
If the person is already booked for that hour. Then dont submit the form.
For example. The person is booked for 21st June from 1pm -3pm. And if for the same person another booking is made for 21st june from 2pm-3pm. On the submission of the form it should not submit and show a notification error.
The start time and end time in the form are date pickers. That is DateValue1, HourValue1 and MinuteValue1.
My current submit button looks like this:
If(
CountRows(
Filter(
RList,
DataCardValue14.Selected.'Name (FirstName)' = SA.Value &&
DateAdd(
DateValue1.SelectedDate,
Time(HourValue1.Selected.Value, MinuteValue1.Selected.Value, 0)
) >= ReservationStartTime &&
DateAdd(
DateValue1.SelectedDate,
Time(HourValue1.Selected.Value, MinuteValue1.Selected.Value, 0)
) < ReservationEndTime
)
) = 0,
SubmitForm(Form2),
Notify("The selected member already has a booking during the selected time slot.", NotificationType.Error)
)
Above SA is a lookup column where I am match the name.