Showing results for 
Search instead for 
Did you mean: 
Resolver I
Resolver I

Book a Room Modifications

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);
    Set(AvailableRoomsCounter, 1);
    UpdateContext({ShowLoading: true});
    Set(RoomsLeft, Blank());
    Set(DateTimeRoomChange, false);
        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("" 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.


Community Support
Community Support

Re: Book a Room Modifications


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?





Resolver I
Resolver I

Re: Book a Room Modifications

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!

Helpful resources


Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!


Community Highlights

Check out whats happening in Power Apps


Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,900)