web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Microsoft Teams or Out...
Power Apps
Unanswered

Microsoft Teams or Outlook Connector

(2) ShareShare
ReportReport
Posted on by
Hi everyone, I'm working on a project to display the available time slots for meeting rooms within our organization. I need to retrieve these details from meeting rooms managed in Microsoft Teams/Outlook and present them in a Power Apps canvas app. Essentially, the user interface should list the meeting rooms. After selecting a specific room and date, it should display the available time slots (times where no meetings are scheduled). What's the best way to achieve this using Outlook/Teams connectors, other Power Apps connectors, or a Power Automate flow? I've been trying to find a solution for a while without success.
Categories:
I have the same question (0)
  • Suggested answer
    Hellen ramos Profile Picture
    12 on at
    Hey there, 
     
    So I'll send you below the step-by-step of how create an event in teams throught Power Apps.
     
    1º step: set the day and time of the event in minutes:
     
    *in this case I only selected the initial date because I simplify the agenda by only showing events from one day. But if you want to see more days, you can add a datepicker to select the final date.
     
    2º step: Create an array with the possible times according to the previous choice (this code will be on an OnSelect property of a button- FindTimes)
    This array will be responsible for displaying the possible times in my schedule. In this case, I'm only searching my times, as you can see in the "RequiredAttendees" column. If you want to insert the email of more people, you can concatenate all the emails you want at this time of search, see an example below:
     
     
    Here's the code: 
    ClearCollect(
        arrTimes,
        AddColumns(
            Office365Outlook.FindMeetingTimesV2(
                {
                    MaxCandidates: 48,
                    MinimumAttendeePercentage: 1,
                    MeetingDuration: ComboboxCanvas1.Selected.Value,//combo box with the time of meeting in minutes
                    Start: DateAdd(DatePickerCanvas1.SelectedDate,0,TimeUnit.Hours), //start date of meeting
                    End: DateAdd(DatePickerCanvas1.SelectedDate+1,0,TimeUnit.Days), //end date of meeting
                    RequiredAttendees: Concatenate(User().Email,";","johndoe@contoso.com"), //emails from attendees
                    ActivityDomain:"Work"
     
                }
            ).meetingTimeSuggestions,
            StartTime,meetingTimeSlot.start.dateTime,
            EndTime,meetingTimeSlot.end.dateTime
        )
    );
     
     
    3º step: add a gallery in your app and set the items property to array that you just created: arrTimes (or whatever the name you give to it)
     
    4º step: on the gallery, add a button and change the text to the time available (I inserted a formula to show the start and end time of available calendar agenda)
     
    Here's the code:
    Text(
        DateAdd(
            ThisItem.StartTime,
            -Mod(
                Minute(ThisItem.StartTime),
                30
            ),
            TimeUnit.Minutes
        ),
        DateTimeFormat.ShortTime
    ) & " - " & Text(
        DateAdd(
            ThisItem.EndTime,
            -Mod(
                Minute(ThisItem.EndTime),
                30
            ),
            TimeUnit.Minutes
        ),
        DateTimeFormat.ShortTime
    )
     
    5º step: on the OnSelect property of button, put the formula below:
    This formula will be responsible for save the correct day and time of the event in your calendar.
     
    Here's the code:
    Set(
        varInitialTime,
        ThisItem.StartTime
    );
    Set(
        varEndTime,
        ThisItem.EndTime
    )
     
    6º step: Create an event with the choosen day and time in your calendar with the Save Time button (the code will be in OnSelect property of button)
     
    PS: the varIdentification and varCalendarID will make it easier to bring the calendar I want to modify to the application. It is not necessary, however, it greatly minimizes errors that may arise when creating events through Power Apps.
     
    Here's the code:
    Set(
        varIdentification,
        Office365Outlook.CalendarGetTables().value
    );
    Set(
        varCalendarID,
        LookUp(
            Office365Outlook.CalendarGetTables().value,
            DisplayName = Last(
                FirstN(
                    varIdentification,
                    2
                )
            ).DisplayName
        ).Name
    );
    Set(
        varInvite,
        MicrosoftTeams.CreateTeamsMeeting(
            varCalendarID,
            "Test",
            {
                content: "Test event",
                contentType: "html"
            },
            "E. South America Standard Time",
            {dateTime: varInitialTime},
            {dateTime: varEndTime},
            true,
            "teamsForBusiness",
            {requiredAttendees: User().Email} //Can be: Concatenate(User().Email,";","johndoe@contoso.com"
        )
    );
     
     
    After all this, you'll probably see the event in your calendar agenda in the specific day and time that you choose.

    Hope that helped!
     
    Best regards!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard