cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Victoria
Kudo Kingpin
Kudo Kingpin

Hiding other items on list for a selected day

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.

Untitled1.png

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. 

Untitled2.png

 

 

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. 

1 ACCEPTED SOLUTION

Accepted Solutions
Victoria
Kudo Kingpin
Kudo Kingpin

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...

View solution in original post

8 REPLIES 8
Abhilash_Swain
Super User
Super User

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.

Victoria
Kudo Kingpin
Kudo Kingpin

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.

Victoria
Kudo Kingpin
Kudo Kingpin

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. 

Untitled5.png

 

Thanks, V

Abhilash_Swain
Super User
Super User

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.


Victoria
Kudo Kingpin
Kudo Kingpin

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. 

Presentation1.gif

Not sure what I did wrong. I followed your instructions. 

Abhilash_Swain
Super User
Super User

@Victoria ,
Please allow me some time to reproduce the same scenario. Seems a minor logic missing.

Victoria
Kudo Kingpin
Kudo Kingpin

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...

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (3,701)