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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Book a room - fixed ti...
Power Apps
Answered

Book a room - fixed time-slots

(1) ShareShare
ReportReport
Posted on by

Hi guys,

 

First off, I'm fairly new with using PowerApps so in case this is a dumb question... please bare with me.  One of our customers asked me if it's possible to create an app from where the employees can book desks at the office. They would like to use it during this ongoing Covid crisis. I've managed to design the 'Book a room' PowerApp for most of their needs.

 

I've figured out how to filter which rooms (desks) should be available for bookings. What I can't figure out if the following.  In stead of letting the employees choose their own 30 min time-slots I'd like to set it up so that they automatically book desks from 08:00am to 18:00pm. So basicly the employee can only book a desk for a full day.

 

I suppose I have to set this up under the 'Landingscreen --> ButtonNoMeeting' code but do not know how to do so. I've filtered out the 'ButtonMeeting' by the way.

 

The default code looks like this:

 

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) + 0; Minutes));;
Set(EndDateTime; DateAdd(StartDateTime; 30; Minutes));
Set(StartDateTime; Now());;
Set(EndDateTime; DateAdd(Now(); -Mod(Minute(Now()); 30) + 0; 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)

)

 

Any help on how to edit this would be greatly appreciated.

 

Thanks in advance.

Andy

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Must be because it's monday morning but I can't figure out how to remove the previous post. Managed to fix it by adding the following:

     

    Set(StartDateTime; DateAdd(Today();8;Hours)
    );
    Set(EndDateTime; DateAdd(Today();18;Hours)
    );

     

    Cheers

    Andy

  • jasonberndt Profile Picture
    2 on at

    Hi Andy,

     

    I have zero experience with Power Apps and have been asked to do the same exact thing regarding booking times. Are you able to share more details regarding how you got this working? I added the lines from your solution but received unexpected character errors.

     

    Thanks in advance,

    Jason

  • RobinAllware Profile Picture
    12 on at

    Hi Andy

    Any chance you could elaborate or share how you did this? Where did you put this code and what other code did you remove to get the result?

    Thanks

  • Nollzie Profile Picture
    45 on at

    Hello, I would like to add the option to book a room for the entire day or multiple days, I am using this to manage 8 pool cars.  I would like to add a button that would allow users to select a day or days from a calendar.  Way beyond my current abilities.

     

    Thanks in advance.

  • Nollzie Profile Picture
    45 on at

    Hi Andy, can you please tell us exactly where to add the provided code, I want to use the App to manage Pool cars, so users need to be able to book 1 or more days.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard