Hey all,
i have issues with the template of the Book a Room App.
Scenario:
Users are just allowed to book certains rooms. We already configured the rooms itself to just accept request from the users.
But it would be great to only show the Users all Rooms which are available/allowed for them.
This wouldnt be an issue, just apply a filter on the Gallery to show only the relevant rooms.
Unfortunately we do have more than 40 rooms so the filter might not show any result (because the List just shows by defaut 40 rooms).
To reduce the number of requests to the Office365 Connector i would like to reduce the Room List from the very beginning.
Here is what i have so far:
Set(IsPrevRoomSelect; false);;
If(DateTimeRoomChange;
Set(AvailableRoomsCounter; 1);;
UpdateContext({ShowLoading: true});;
Set(RoomsLeft; Blank());;
If(!NoRoomsList;
ClearCollect(AllRooms; Office365.GetRoomsInRoomList(RoomsListsGallery.Selected.Address).value)
);;
Set(DateTimeRoomChange; false);;
Set(NumberofRooms;CountRows(Filter(AllRooms;StartsWith(Name;"2.30"))));;
Set(AllRoomsConnector;Concat(FirstN( Filter(AllRooms;StartsWith(Name;"2.30")) ;20) ;Address & ";"));;
Concurrent(
ClearCollect(AvailableRooms; Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector; IsOrganizerOptional: true;
Start: StartDateTimeUTC; End: EndDateTimeUTC; MeetingDuration: DateDiff(StartDateTime; EndDateTime; Minutes);
MinimumAttendeePercentage: "1"; ActivityDomain: "Unrestricted"}));
If(NumberofRooms > 20;
If(NumberofRooms > 40;
Set(AllRoomsConnector1; Concat(LastN(FirstN(AllRooms; 40); 20); Address & ";"));
Set(AllRoomsConnector1; Concat(LastN(AllRooms; NumberofRooms - 20); Address & ";"))
);;
ClearCollect(AvailableRooms1; Office365.FindMeetingTimes({RequiredAttendees: AllRoomsConnector1; IsOrganizerOptional: true;
Start: StartDateTimeUTC; End: EndDateTimeUTC; MeetingDuration: DateDiff(StartDateTime; EndDateTime; Minutes);
MinimumAttendeePercentage: "1"; ActivityDomain: "Unrestricted"})
);
Clear(AvailableRooms1)
)
);;
If(NumberofRooms > 20;
Collect(AvailableRooms; AvailableRooms1)
);;
ClearCollect(AvailableRoomsSorted; SortByColumns(First(AvailableRooms).MeetingTimeSuggestions; "Confidence"; Descending); If(NumberofRooms> 20; SortByColumns(Last(AvailableRooms).MeetingTimeSuggestions; "Confidence"; Descending)));;
ClearCollect(AvailableRoomsConcat; Concat(Filter(First(AvailableRoomsSorted).AttendeeAvailability; Availability = "Free");
Attendee.EmailAddress.Address; ","); If(NumberofRooms > 20; Concat(Filter(Last(AvailableRoomsSorted).AttendeeAvailability; Availability = "Free");
Attendee.EmailAddress.Address; ",")));;
ClearCollect(AvailableRoomEmails; Split(First(AvailableRoomsConcat).Value; ","); If(NumberofRooms > 20; Split(Last(AvailableRoomsConcat).Value; ",")));;
ClearCollect(AvailableRoomEmailName; AddColumns(RenameColumns(AvailableRoomEmails; "Result"; "Email"); "Name";
LookUp(AllRooms; Email = Address).Name));;
UpdateContext({ShowLoading: false});;
Set(RoomsLeft; NumberofRooms - 40 * AvailableRoomsCounter)
);;
Clear(AvailableRooms);;
Clear(AvailableRooms1)
My Problem:
The Gallery which is referring to AvailableRoomEmailName is still showing all rooms.
What was the idea:
Just reduce the Allroomsconnctor to only request the Rooms which are allowed to the user.
I am looking forward to some input from the pros 🙂

Report
All responses (
Answers (