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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

Top Solution Authors
Top Kudoed Authors
Users online (69,043)