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 Modifications
Power Apps
Unanswered

Book a Room Modifications

(0) ShareShare
ReportReport
Posted on by 112

Hi all,

 

I am trying to make an app that will allow users to schedule a meeting. This app would be on an iPad, directly outside of the conference room. I want to make many versions of this app, for all of the different conference rooms. I would like each app to have its corresponding conference room as the "main screen". This main screen should display a picture in green if the room is directly available, and red if it is not available. The room I am conducting testing with, is called "Olympus", and has a dedicated email for scheduling, using Outlook.

 

Currently, in order to refresh the data every 30 seconds, I have a timer, with the OnEnd code:

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(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);
Set(CalendarFromSelectMeeting, false);
If(DateTimeRoomChange,
 Set(AvailableRoomsCounter, 1);
 UpdateContext({ShowLoading: true});
 Set(RoomsLeft, Blank());
 Set(DateTimeRoomChange, false);
 If(!NoRoomsList,
 ClearCollect(AllRooms, Office365.GetRoomsInRoomList(RoomsListsGallery.Selected.Address).value)
 );
 If(CountRows(AllRooms) > 20,
 Set(AllRoomsConnector, Concat(FirstN(AllRooms, 20), Address & ";")),
 Set(AllRoomsConnector, Concat(AllRooms, Address & ";"))
 );

 ClearCollect(AvailableRooms, Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector, IsOrganizerOptional: true, 
 Start: StartDateTimeUTC, End: EndDateTimeUTC, MeetingDuration: DateDiff(StartDateTime, EndDateTime, Minutes),
 MinimumAttendeePercentage: "1", ActivityDomain: "Unrestricted"}));

 ClearCollect(AvailableRoomsSorted, SortByColumns(First(AvailableRooms).MeetingTimeSuggestions, "Confidence", Descending));

 ClearCollect(AvailableRoomsConcat, Concat(Filter(First(AvailableRoomsSorted).AttendeeAvailability, Availability = "Free"), 
 Attendee.EmailAddress.Address, ","));

 ClearCollect(AvailableRoomEmails, Split(First(AvailableRoomsConcat).Value, ","));

 ClearCollect(AvailableRoomEmailName, AddColumns(RenameColumns(AvailableRoomEmails, "Result", "Email"), "Name", 
 LookUp(AllRooms, Email = Address).Name, "Capacity", "Capacity"));

 UpdateIf(AvailableRoomEmailName, Name = "GoPro", {Capacity: "Large"});
 UpdateIf(AvailableRoomEmailName, Name = "Kodak" || Name = "Olympus", {Capacity: "Medium"});
 UpdateIf(AvailableRoomEmailName, Name = "Polaroid", {Capacity: "Small"});

 UpdateContext({ShowLoading: false});
 Set(RoomsLeft, CountRows(AllRooms) - 20 * AvailableRoomsCounter)
)

This is all code directly from the "OnVisible" of the RoomSelectScreen in the Book a Room template (I have added the UpdateIf codes).

 

Since I have a method to refresh the collections, I am using this code for the background color fill:

If("Olympus@ourdomainhere.com" in AvailableRoomEmails.Result,RGBA(43, 121, 35, 0.62),RGBA(102, 7, 7, 0.63))

 

This method does not seem to work very well. Occasionally, when booking a room, this method does work; however, the app seems to have trouble when meetings end. When a meeting ends, the color stays at red.

 

For some troubleshooting, I have added a Gallery, with AvailableRoomEmails, and a label with Results. It appears that the collection (either through the OnVisible of the screen, or the timer), does not see that the room is no longer booked. When a meeting ends, Olympus does not populate back into AvailableRoomEmails.

 

I am hoping someone has another method they can share with me.

 

Categories:
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    @TBuente 

    I have made a simple test, and don't have the issue you mentioned.

    Could you try to remove the following formula in your codes and try again?

    Snipaste_2020-01-20_16-27-49.png

    Sik

     

     

  • TBuente Profile Picture
    112 on at

    Nothing much has changed after taking that code out of the OnEnd for the timer.

     

    After some testing, it appears that Olympus is removed from "AvailableRoomsEmail" almost as soon as you make a meeting. As a test, I made a meeting for Olympus at 3:45PM. I created the meeting at 3:20PM. By 3:25PM, the availability for Olympus became unavailable, even though the meeting isn't scheduled until 3:45PM.

     

    As far as when Olympus refreshes back onto AvailableRoomEmail, it seems to refresh back into the collection about 3~5 minutes after the meeting actually ends. While its not preferred, 3 to 5 minutes is an acceptable cushion; however, the start time is a big issue.

     

    I will continue troubleshooting this, but please let me know if you come up with anything, I greatly appreciate the effort to help me!

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard