cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SteveBouten
Frequent Visitor

Color fill time slots - booking schedule

Good afternoon all,

 

I'm trying to create an availability screen for our car bookings (see attached) based on the start date/time & end date/time.

All the booking info is available in a SharePoint list (see attached)

 

Test booking: 07/04/2021 10:00 - 08/04/2021 11:30 // Duration is 1530 minutes.

The lookup searches the list for the Start Date, Allocated vehicle (VBE08) & Start Time and then gives the "DurationMin" column value in the corresponding label.

 

I'd like it to color all the labels from the start date/time until the end date/time, including the next date when it's a long booking.

 

This formula is currently in the fill for 10:30: If(lblAsset1_6-30>=0,Red, lblAsset1_7-30>=0,Red,Transparent)

lblAsset1_6 = label next to 10:00

lblAsset1_7 = label next to 10:30

 

Any help would be much appreciated.

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @SteveBouten :

Do you want to get something like this?

32.gif

I've made a test for your reference:
1\My data source (SteveBoutenList)

Column (click to edit) Type
Title Single line of text
StartDate Date and Time(Date Only)
StartTime Single line of text
EndDate Date and Time(Date Only)
EndTime Single line of text

1.PNG

2\Add a date picker control(DatePicker1)

3\Add a gallery and set it's items property to

ForAll(
    Sequence(21,0,1),
    DateAdd(
        DatePicker1.SelectedDate + Time(7,30,0),
        30 * Value,
        Minutes
    )
)

4\Add a label control in to the gallery

Text

Text(ThisItem.Value,"[$-en]HH:mm")

BorderThickness

1

 5\Add an other label control control in to the gallery

Fill

With(
    {
        TheTable: Filter(SteveBoutenList,Title = "VBE08")
    },
    If(
        CountRows(
            Filter(
                TheTable,
                ThisItem.Value >= DateTimeValue(Text(StartDate,"[$-en]yyyy/mm/dd") & " " & StartTime) && 
                ThisItem.Value <= DateTimeValue(Text(EndDate,"[$-en]yyyy/mm/dd") & " " & EndTime))
        ) > 0,
        Red,
        RGBA(0,0,0,0)
    )
)

BorderThickness

 

1

 

Best Regards,

Bof

View solution in original post

2 REPLIES 2
v-bofeng-msft
Community Support
Community Support

Hi @SteveBouten :

Do you want to get something like this?

32.gif

I've made a test for your reference:
1\My data source (SteveBoutenList)

Column (click to edit) Type
Title Single line of text
StartDate Date and Time(Date Only)
StartTime Single line of text
EndDate Date and Time(Date Only)
EndTime Single line of text

1.PNG

2\Add a date picker control(DatePicker1)

3\Add a gallery and set it's items property to

ForAll(
    Sequence(21,0,1),
    DateAdd(
        DatePicker1.SelectedDate + Time(7,30,0),
        30 * Value,
        Minutes
    )
)

4\Add a label control in to the gallery

Text

Text(ThisItem.Value,"[$-en]HH:mm")

BorderThickness

1

 5\Add an other label control control in to the gallery

Fill

With(
    {
        TheTable: Filter(SteveBoutenList,Title = "VBE08")
    },
    If(
        CountRows(
            Filter(
                TheTable,
                ThisItem.Value >= DateTimeValue(Text(StartDate,"[$-en]yyyy/mm/dd") & " " & StartTime) && 
                ThisItem.Value <= DateTimeValue(Text(EndDate,"[$-en]yyyy/mm/dd") & " " & EndTime))
        ) > 0,
        Red,
        RGBA(0,0,0,0)
    )
)

BorderThickness

 

1

 

Best Regards,

Bof

View solution in original post

Hi Bof,

 

That's exactly what I was looking for. Thank you so much!!

 

Kind regards,

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,175)