cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TBuente
Level 8

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);
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.

 

2 REPLIES 2
Microsoft v-siky-msft
Microsoft

Re: Book a Room Modifications

@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
Level 8

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

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (6,115)