Hello, i have a problem with gallery filter. Now i'm trying to do it with excel, but it doesnt't work if i use sharepoint too. So i have two tables in Excel, first is called Floor1, where data about desks is stored with column Title (Desk 1, Desk 2 etc), and Reservation1, where data about reservations is stored with colums Title (John Doe Desk 1), DeskText (Desk 1, Desk 2, etc), CheckOutFrom (start date) and CheckOutTo (end date). Reservations write to Reservation1 successfully, but filter in my gallery doesn't work correctly. The formula I am using right now for gallery items is:
Filter(tbFloor1,Not(Title in Filter(tbReservation1,CheckOutFrom >= startTime && CheckOutTo <= endTime || CheckOutFrom <= endTime && CheckOutTo >= endTime).DeskText))
startTime and endTime are variables set on OnSelect property of Continue button after selecting dates in calendar component. In calendar component there is selected Range option.
Set(selectedDate,Calendar_1.StartDate);
Set(selectedDateEnd,Calendar_1.EndDate);
Set(startTime,DateValue(Text(selectedDate,DateTimeFormat.ShortDate)));
Set(endTime,DateValue(Text(selectedDateEnd,DateTimeFormat.ShortDate)))
What is working: when i select one date and reserve it, it doesn't appear in gallery, BUT
1) if i reserve, for example, Desk1 on 1st May, this desk won't show on 1st of May, but also on any date before and after 1st of May, even tho it is free (here i think problem is that when you click once on date on calendar, only CheckOutFrom is written (1/5/2021) and CheckOutTo remains blank. But if i click twice on date, then both CheckOutForm & CheckOutTo are 1/5/2021 and i am able to reserve this desk on other dates. So maybe the question is, is there a way to say to the powerapp, that if only startTime is selcted, then they should be equal with endTime, so it could understand that it is reserved for one day only?
2) If i reserve a range, for example, 3-5 May, even tho the dates will be correctly written in CheckOutFrom 3/5/2021 and CheckOutTo 5/5/2021, i will be able to reserve all these dates, 3,4,5th of May.
It is very important for my app, if someone has the answer, please, i will be very grateful!