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 / Book a Room Template
Power Apps
Answered

Book a Room Template

(0) ShareShare
ReportReport
Posted on by 12

Hi, I´m using the book a room tample for booking parking spaces instead of rooms.
I would like to eliminate the drop down menu and be able to select 3 different time slots. From 8-12 pm, from 12-4 pm and 8-4pm.  I want to have only three buttons with : Mornings, Afternoons and the whole day which pics the time . Is it pissible? 

Many thanks in advance 

Categories:
I have the same question (0)
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @Liridona ,

     

    I did a test for you.

    1\ Try this formula on this button control.

     

    Set(DateSelected, Today());
    Set(DateTimeRoomChange, true);
    /*If(Mod(Minute(Now()), 30) <= 14,
    Set(StartDateTime, DateAdd(Now(), -Mod(Minute(Now()), 30), Minutes));
    Set(EndDateTime, DateAdd(StartDateTime, 30, Minutes)),
    Mod(Minute(Now()), 30) >= 15,
    Set(StartDateTime, DateAdd(Now(), -Mod(Minute(Now()), 30) + 30, Minutes));
    Set(EndDateTime, DateAdd(StartDateTime, 30, Minutes)),
    Set(StartDateTime, Now());
    Set(EndDateTime, DateAdd(Now(), -Mod(Minute(Now()), 30) + 60, Minutes))
    );*/
    Set(StartDateTime,DateAdd(Today(),480,Minutes));
    Set(EndDateTime,DateAdd(Today(),720,Minutes));
    Set(StartDateTimeUTC, Text(DateAdd(StartDateTime, TimeZoneOffset(), Minutes), "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");
    Set(EndDateTimeUTC, Text(DateAdd(EndDateTime, TimeZoneOffset(), Minutes), "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");
    Set(BookForMeeting, false);
    
    If(NoRoomsList,
    Navigate(RoomSelectScreen, Cover),
    
    Navigate(RoomListSelectScreen, Cover)
    )

     

    v-xiaochen-msft_0-1619576420947.png

     

    2\ Add 3 button control and set their onselect property to:

    Morning button control:

     

    Set(StartDateTime, DateAdd(DateSelected, 480, Minutes));
    Set(EndDateTime, DateAdd(DateSelected, 720, Minutes));
    Set(StartDateTimeUTC, Text(DateAdd(StartDateTime, TimeZoneOffset(), Minutes), "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");
    Set(EndDateTimeUTC, Text(DateAdd(EndDateTime, TimeZoneOffset(), Minutes), "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z")
    

     

    Afternoon button control:

     

    Set(StartDateTime, DateAdd(DateSelected, 720, Minutes));
    Set(EndDateTime, DateAdd(DateSelected, 960, Minutes));
    Set(StartDateTimeUTC, Text(DateAdd(StartDateTime, TimeZoneOffset(), Minutes), "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");
    Set(EndDateTimeUTC, Text(DateAdd(EndDateTime, TimeZoneOffset(), Minutes), "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z")

     

    Whole day button control:

     

    Set(StartDateTime, DateAdd(DateSelected, 480, Minutes));
    Set(EndDateTime, DateAdd(DateSelected, 960, Minutes));
    Set(StartDateTimeUTC, Text(DateAdd(StartDateTime, TimeZoneOffset(), Minutes), "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z");
    Set(EndDateTimeUTC, Text(DateAdd(EndDateTime, TimeZoneOffset(), Minutes), "[$-en-US]yyyy-mm-ddThh:mm") & ":00.000Z")

     

    v-xiaochen-msft_1-1619576535383.png

     

    3\ Set the DisplayMode property like picture:

    v-xiaochen-msft_2-1619576575744.png

     

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

     

  • Liridona Profile Picture
    12 on at

    Hi Wearsky, 

    thanks a lot for your help. 

    Best,

    Liridona 

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 491

#2
WarrenBelz Profile Picture

WarrenBelz 407 Most Valuable Professional

#3
11manish Profile Picture

11manish 331

Last 30 days Overall leaderboard