cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Markie
Helper III
Helper III

Check specific meeting room availability

Hi!

 

Im wondering how can i get availability for the specific room for the next X hours and display it in the gallery?

 

Any tips to get specific rooms availability?


Thanks in advance!

5 REPLIES 5
v-yangar-msft
Microsoft
Microsoft

Hi @Markie ,

 

You can get availability for the specific room for the next X hours and display it in the gallery.

I do a demo which can realize your requirement:

1.Add a Office 365 Outlook connector.

2.Add a datepicker control.

3.Set a variable in the Onselect property of DatePicker:

ClearCollect(Times, {Text: "12:00 am", Minutes: 0}, {Text: "12:30 am", Minutes: 30}, {Text: "1:00 am", Minutes: 60}, {Text: "1:30 am", Minutes: 90}, {Text: "2:00 am", Minutes: 120}, {Text: "2:30 am", Minutes: 150}, {Text: "3:00 am", Minutes: 180}, {Text: "3:30 am", Minutes: 210}, {Text: "4:00 am", Minutes: 240}, {Text: "4:30 am", Minutes: 270}, {Text: "5:00 am", Minutes: 300}, {Text: "5:30 am", Minutes: 330}, {Text: "6:00 am", Minutes: 360}, {Text: "6:30 am", Minutes: 390}, {Text: "7:00 am", Minutes: 420}, {Text: "7:30 am", Minutes: 450}, {Text: "8:00 am", Minutes: 480}, {Text: "8:30 am", Minutes: 510}, {Text: "9:00 am", Minutes: 540}, {Text: "9:30 am", Minutes: 570}, {Text: "10:00 am", Minutes: 600}, {Text: "10:30 am", Minutes: 630}, {Text: "11:00 am", Minutes: 660}, {Text: "11:30 am", Minutes: 690}, {Text: "12:00 pm", Minutes: 720}, {Text: "12:30 pm", Minutes: 750}, {Text: "1:00 pm", Minutes: 780}, {Text: "1:30 pm", Minutes: 810}, {Text: "2:00 pm", Minutes: 840}, {Text: "2:30 pm", Minutes: 870}, {Text: "3:00 pm", Minutes: 900}, {Text: "3:30 pm", Minutes: 930}, {Text: "4:00 pm", Minutes: 960}, {Text: "4:30 pm", Minutes: 990}, {Text: "5:00 pm", Minutes: 1020}, {Text: "5:30 pm", Minutes: 1050}, {Text: "6:00 pm", Minutes: 1080}, {Text: "6:30 pm", Minutes: 1110}, {Text: "7:00 pm", Minutes: 1140}, {Text: "7:30 pm", Minutes:1170}, {Text: "8:00 pm", Minutes: 1200}, {Text: "8:30 pm", Minutes: 1230}, {Text: "9:00 pm", Minutes: 1260}, {Text: "9:30 pm", Minutes: 1290}, {Text: "10:00 pm", Minutes: 1320}, {Text: "10:30 pm", Minutes: 1350}, {Text: "11:00 pm", Minutes: 1380}, {Text: "11:30 pm", Minutes: 1410});

4.Add two drop down controls and set the Items property of them to Collection Timers

5.Add a button named Confirm

6.Set the OnSelect property of button to:

Set(StartDateTime, DateAdd(DatePicker1.SelectedDate, StartTime.SelectedText.Minutes, Minutes));

Set(EndDateTime, DateAdd(StartDateTime, If(StartTime.SelectedText.Minutes >= EndTime.SelectedText.Minutes, EndTime.SelectedText.Minutes + 1440 -StartTime.SelectedText.Minutes, EndTime.SelectedText.Minutes - StartTime.SelectedText.Minutes), 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(StartTimeMinutes, StartTime.SelectedText.Minutes);

Set(EndTimeMinutes, If(EndTime.SelectedText.Minutes < StartTime.SelectedText.Minutes, EndTime.SelectedText.Minutes + 24*60, StartTime.SelectedText.Minutes));

ClearCollect(AllRooms, Office365Outlook.GetRoomLists().value);      Set(AllRoomsConnector, Concat(FirstN(AllRooms, 20), Address & ";"));

Set(AllRoomsConnector, Concat(AllRooms, Address & ";"));

ClearCollect(AvailableRooms, Office365Outlook.FindMeetingTimesV2({RequiredAttendees: AllRoomsConnector, IsOrganizerOptional: true,

 Start: StartDateTimeUTC, End: EndDateTimeUTC, MeetingDuration: DateDiff(StartDateTime, EndDateTime, Minutes),MinimumAttendeePercentage: "1", ActivityDomain: "Unrestricted"}));

ClearCollect(AvailableRoomsSorted, First(AvailableRooms).meetingTimeSuggestions);

ClearCollect(AvailableRoomsFree,Concat(Filter(First(AvailableRoomsSorted).attendeeAvailability,availability="free"),attendee.emailAddress.address,","));

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

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

7.Add a gallery and set the items property of it to CollectionAvailableRoomEmailName

8.When you select the date ,start and end time, click Cofrim button, the available rooms will display in the gallery as below:

 

1.PNG

Here is a ralated template which can meet the same requirements and you can find it in https://make.powerapps.com/

Choose ‘Create’ and type ‘book’ in the ‘Start from template’ and choose “Book A Room”

 

 

Hope it helps!

 

Thanks,

Arrow

Hmmm, it seems that the following collections:

AvailableRoomEmails, AvailableRoomEmailName, AvailableRoomsSorted,AvailableRoomsFree

 

Are all blank 😞 

v-yangar-msft
Microsoft
Microsoft

Hi @Markie ,

 

Is there any values in collection 'AvailableRooms'? Because 'Office365Outlook.FindMeetingTimesV2' is the key to get available rooms.

Besides, could you please share the formula in your side or anything error you are facing?

 

Thanks,

Arrow

availablerooms1.PNGavailablerooms2.PNG

here's how the collection looks like 😞

v-yangar-msft
Microsoft
Microsoft

Hi @Markie ,

 

There isn't any value in your AvailableRooms, i think that you miss the parameters in function Office365Outlook.FindMeetingTimesV2(). Please make sure the right parameters and there is available rooms during you selected time period.

Additionally, if you are still in the trouble with this function, you can find the related app in https://make.powerapps.com/

1.Choose ‘Create’ and type ‘book’ in the ‘Start from template’ and choose “Book A Room”

2.Open it and find the sample of using function Office365Outlook.FindMeetingTimesV2() here:

sample.PNGHope it helps!

 

Thanks,

Arrow

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (45,368)