Hello. I have a desk reservation app which I set up to be bookable by the day. Now my users have asked for the ability to book am or pm or the whole day, so trying to make that work. The booking screen now has 2 galleries.
Gallery 1 is linked to a list called 'Desks' which just holds the desks. Gallery 2 is linked to a list called 'DeskRequests' which has available bookable timeslots AM, PM or All day. Each slot is a seperate item on my 'DeskRequests' list. So there are 3 potential choices per desk, for each day.
I'm patching on the save button to capture the booking - this changes the status column to booked and captures the logged in user.
I'm looking for a method to hide/remove the other timeslots available on that day, once a booking is made.
When a user books a desk for the whole day, I want to remove the am and pm slots.
When a user books AM or PM, I want to remove the All day slot.
Not sure if there is a way to convert them to 'booked' as appropriate, at the same time, on the save button or if I can filter some how. I am already filtering gallery2 by the selected desk in Gallery1, status (ie available) and the date
Filter(DeskRequests, Desks=LabelHiddenToFilterOnSelectedDesk.Text, Status.Value = "Available" && Text(Date,ShortDate) = Text(DatePicker1.SelectedDate,ShortDate))
Not sure whether I can filter somehow or if I need to update the other items on the save button some how.
It's the last part of the puzzle! Any help would be gratefully received. Thanks.
Solved! Go to Solution.
Found a way to do this using count rows, all within the Items property...
Filter(
DeskRequests,
Text(
Date,
ShortDate
) = Text(
DatePicker1.SelectedDate,
ShortDate
),
Desks = LabelFilterSelectedDesk.Text,
Status.Value = "Available",
If(
Timeslots = "All day",
CountRows(
Filter(
DeskRequests,
Text(
Date,
ShortDate
) = Text(
DatePicker1.SelectedDate,
ShortDate
),
Desks = LabelFilterSelectedDesk.Text,
Status.Value = "Booked",
Timeslots = "PM" || Timeslots = "AM"
)
) = 0,
CountRows(
Filter(
DeskRequests,
Text(
Date,
ShortDate
) = Text(
DatePicker1.SelectedDate,
ShortDate
),
Desks = LabelFilterSelectedDesk.Text,
Status.Value = "Booked",
Timeslots = "All day"
)
) = 0
)
)
in case it helps anyone else...
Hi @Victoria ,
You can use a if to achieve the conditions.
Goto Display property Of AM and PM checkbox.
If(First(Filter(DeskRequests, Desks=LabelHiddenToFilterOnSelectedDesk.Text && TimeSlots ="All Day")).Status = "Booked", Display.Disable,Display.Edit)
Same for PM checkbox.
So anytime , all day is booked, Both AM and PM for that desk will be disabled.
Hello. Thanks for helping. I'm confused, I'm not sure where the Display property is? There is only DisplayMode as far as I can see. The checkbox is inside Gallery4, which pull from the Timeslots column on the DeskRequests list, so I'm not sure I can set individual conditions on each checkbox.
Appreciate your help, Vicki
Hi @Victoria ,
Yes, it is DisplayMode.
You can apply individual conditions on each box.
Thank you. Sorry I'm going to need a little more info.
Can you explain how I set individual conditions - since I can only select the first check box.
Thanks, V
Hi @Victoria ,
Write this to 1st checkbox displayMode.
If(AND(First(Filter(DeskRequests, Desks=LabelHiddenToFilterOnSelectedDesk.Text && TimeSlots ="All Day")).Status = "Booked", Or(Thisitem.Titel8.text = "AM",Thisitem.Titel8.text = "PM")), Display.Disable,Display.Edit)
Here we are extending the logical check by checking if This Item Title is "AM or "PM".
Hope this will solve your query.
This is frustrating... the text boxes are not showing up and the conditions don't appear to be working, since the AM & PM slots are still showing up when a user books 'All day' etc.
Not sure what I did wrong. I followed your instructions.
@Victoria ,
Please allow me some time to reproduce the same scenario. Seems a minor logic missing.
Found a way to do this using count rows, all within the Items property...
Filter(
DeskRequests,
Text(
Date,
ShortDate
) = Text(
DatePicker1.SelectedDate,
ShortDate
),
Desks = LabelFilterSelectedDesk.Text,
Status.Value = "Available",
If(
Timeslots = "All day",
CountRows(
Filter(
DeskRequests,
Text(
Date,
ShortDate
) = Text(
DatePicker1.SelectedDate,
ShortDate
),
Desks = LabelFilterSelectedDesk.Text,
Status.Value = "Booked",
Timeslots = "PM" || Timeslots = "AM"
)
) = 0,
CountRows(
Filter(
DeskRequests,
Text(
Date,
ShortDate
) = Text(
DatePicker1.SelectedDate,
ShortDate
),
Desks = LabelFilterSelectedDesk.Text,
Status.Value = "Booked",
Timeslots = "All day"
)
) = 0
)
)
in case it helps anyone else...
User | Count |
---|---|
163 | |
86 | |
71 | |
64 | |
62 |
User | Count |
---|---|
210 | |
149 | |
97 | |
84 | |
66 |