web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Color fill time slots ...
Power Apps
Answered

Color fill time slots - booking schedule

(1) ShareShare
ReportReport
Posted on by 24

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!

 

AV_Schedule1.PNG
BookingInfo.png
Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    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

  • SteveBouten Profile Picture
    24 on at

    Hi Bof,

     

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

     

    Kind regards,

  • Suresh_Pune_91 Profile Picture
    16 on at

    where we are using StartDate,EndDate, StartTime,EndTime in the gallery/form?

     

  • SteveBouten Profile Picture
    24 on at

    The input comes from a form and the results are showing in a gallery as shown below.

     

    Time.png

  • Suresh_Pune_91 Profile Picture
    16 on at

    Hi @v-bofeng-msft ,

    Can we fill the slots automatically based on the start time and end time?

    For example, I have a selected a specific date and time , let say, 17/02/2023. Start Time: 10:00 , End Time 12:30.

    I need to fill the calendar with red color On change of Time slots instantly. Is this possible? if yes, Kindly guide me how to achieve this? Thanks in advance

  • SteveBouten Profile Picture
    24 on at

    Hi,

    That's the same as how I do it, if you follow Bof's tutorial above you'll be able to do that.

     

    Kind regards,

  • Suresh_Pune_91 Profile Picture
    16 on at

    The above formula is changing the color of the filled slots by filtering the Table data. But I need to change the color when an user select the date and time slot in the form. 

    Suresh_Pune_91_0-1677136303092.png

    The selected time slot should be replaced with Red Color on change of StartTime & EndTime.

    Please help me on this.

     

    Regards,

    Suresh

  • SteveBouten Profile Picture
    24 on at

    Hi Suresh,

    On my app the user has already completed the Start date/time & End date/time. When we allocated a vehicle to it and submit the form the booked time becomes red. Is that what you want? Because the above solution is linked to the input form.

    Before allocating a vehicleBefore allocating a vehicle After allocating a vehicleAfter allocating a vehicle

    Kind regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard