cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Book a Room Template

Would anyone be able to tell me how the "Book a Room" Power Apps template gets the event/calendar data out of Room calendars in outlook?

 

I can't seem to find the code that is pulling in this information, such as where the "AvailableRoomEmailName" etc. variables are set.

Many thanks,

Maria

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @Maria_L ,

How  "AvailableRoomEmailName" get:

Please notice the RoomSelectScreen's OnVisible:

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

1141.PNG

 

The Office365.FindMeetingTimes function is the key point in these formulas.

You could refer this function here:

https://docs.microsoft.com/en-us/connectors/office365/

 

What's more, if you want to know how the collection create, please notice these properties: screen's OnVisible, button's OnSelect, drop down's OnChange, form's OnSuccess, ect.

These properties are the most possible properties related to the creation of collection.

 

 

Best regards,

Phoebe

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support
Community Support

Hi @Maria_L ,

How  "AvailableRoomEmailName" get:

Please notice the RoomSelectScreen's OnVisible:

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

1141.PNG

 

The Office365.FindMeetingTimes function is the key point in these formulas.

You could refer this function here:

https://docs.microsoft.com/en-us/connectors/office365/

 

What's more, if you want to know how the collection create, please notice these properties: screen's OnVisible, button's OnSelect, drop down's OnChange, form's OnSuccess, ect.

These properties are the most possible properties related to the creation of collection.

 

 

Best regards,

Phoebe

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Perfect, thank you @v-yutliu-msft !

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Top Solution Authors
Top Kudoed Authors
Users online (70,103)