For First, you can combine your current code like -> Yes, I'm using the same the code
If
(
!IsBlank(LookUp(DeskBooking,Employee.Email = UserInfo.Email && MySlotTime)), DisplayMode.Disabled,
!IsBlank(LookUp(DeskBooking,MySlotTime && Title = MainGallery.Selected.Title)), DisplayMode.Disabled
)
For Second, I have tried to use the code but it's not working
Behavior function in a non-behavior property. You can't use this propert to change values elsewhere in the app.
Delegation warning. The highlighted part of this formula might not work correctly on large data sets. The "CountRows" operation is not supported by this connector.
The function 'If' has some invalid arguments.
--
The Book button / Visible:
UpdateContext({IsMorethan2Bookings : false});
ForAll(DateDiff(Calendar_1.StartDate, Calendar_1.EndDate),
If(CountRows(
Filter(OfficeBooking_1,
Employee.Email = UserInfo.Email && FromDate = DateAdd(Calendar_1.StartDate, ThisRecord.Value,Days)
)) >= 2,UpdateContext({IsMorethan2Bookings : true});
) //If
); //ForAll
If(IsMorethan2Bookings, Notify("You can't book more than two desks in single day"),
Patch(.....)
)

