cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bhanney2323
Resolver I
Resolver I

Getting the Right Date and Time For Teams Meeting Invite

Hey, so my HR Department wanted to create an hr form for people to use to put in requests and schedule meetings. Easy enough, I made a list for the responses to be recorded to and then I made a form powerapp from that list. Now I'm on the part where I need to give users the option to create a meeting with hr and so I just used the out of the box meeting screen when you go to new screen -> meeting. This is exactly what I need; however, I'm having some trouble getting my start date and end date in the right format for the create teams meeting function. IT keeps saying expecting record value instead of text. Now I do understand the function Text is right before it, but because I'm using this out of the box screen, I'm not sure how they set up their date time and I'm literally just using the start time from the normal send invite button out of the box and its not working. Please help

 

MicrosoftTeams.CreateTeamsMeeting(
    /*Uses calendar, dont change*/
    LookUp(Office365Outlook.CalendarGetTablesV2().value, DisplayName = "Calendar").name,
    /*subject of the meeting*/
    TextMeetingSubject1.Text,
    /*With Teams you need to declare the structure*/
    {content: TextMeetingMessage1.Text, contentType: "html"},
    /*TimeZone*/
    "Eastern Standard Time",
    /*meeting start time*/
    Text(DateAdd(DateTimeValue(_selectedMeetingTime.StartTime), -TimeZoneOffset(), Minutes)),
     /*meeting end time*/
    Text(DateAdd(DateTimeValue(_selectedMeetingTime.EndTime), -TimeZoneOffset(), Minutes)),
    /*IS this an online meeting? Don't change this*/
    true,
    /*don't change this either*/
    "teamsForBusiness",
    //attendees
    {requiredAttendees:MeetingPeopleGallery1.Selected.UserPrincipalName}
)

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

Hi @bhanney2323 ,

So my previous answer was just a guess from the documentation - but this time I actually tried it....suffice it to say, practice is way different to theory in this case 🙄.

Seems like the method is looking for an actual record with a dateTime column of type text.  Inside the record construct datetime expressions or variables seem to get auto-converted.
Plus, you're already specifying the timezone, so there should be no need to adjust for it in your datetime with TimeZoneOffset().

Try this;

MicrosoftTeams.CreateTeamsMeeting(
    /*Uses calendar, dont change*/
    LookUp(Office365Outlook.CalendarGetTablesV2().value, DisplayName = "Calendar").name,
    /*subject of the meeting*/
    TextMeetingSubject1.Text,
    /*With Teams you need to declare the structure*/
    {content: TextMeetingMessage1.Text, contentType: "html"},
    /*TimeZone*/
    "Eastern Standard Time",
    /*meeting start time*/
    {dateTime: _selectedMeetingTime.StartTime},
     /*meeting end time*/
    {dateTime: _selectedMeetingTime.EndTime},
    /*IS this an online meeting? Don't change this*/
    true,
    /*don't change this either*/
    "teamsForBusiness",
    //attendees
    {requiredAttendees:MeetingPeopleGallery1.Selected.UserPrincipalName}
)

If it works without errors, but you don't see the meeting appear in your diary - maybe check from a day before to a day after, just in case there are timezone conversion issues somewhere, but otherwise it should work.

 

Hope this helps,

RT

View solution in original post

8 REPLIES 8
RusselThomas
Microsoft
Microsoft

Hi @bhanney2323,

Based on the connector reference the expected type is "date-no-tz" - so the format has to look something like '2017-08-29T04:00:00'.

Try this;

Text(DateAdd(DateTimeValue(_selectedMeetingTime.StartTime), -TimeZoneOffset(), Minutes), "[$-en-US]yyyy-mm-ddThh:mm:ss")

Hope his helps,

RT

bhanney2323
Resolver I
Resolver I

Thanks for the help Russel! I think this is a step in the right direction; however, I'm still getting the error: " The function Create Teams Meeting has some invalid arguments. Invalid argument type (text) expecting a record value instead" 

 

Not sure if you have any ideas on that, but I'll keep messing around and researching on what I can find

RusselThomas
Microsoft
Microsoft

Hi @bhanney2323 ,

So my previous answer was just a guess from the documentation - but this time I actually tried it....suffice it to say, practice is way different to theory in this case 🙄.

Seems like the method is looking for an actual record with a dateTime column of type text.  Inside the record construct datetime expressions or variables seem to get auto-converted.
Plus, you're already specifying the timezone, so there should be no need to adjust for it in your datetime with TimeZoneOffset().

Try this;

MicrosoftTeams.CreateTeamsMeeting(
    /*Uses calendar, dont change*/
    LookUp(Office365Outlook.CalendarGetTablesV2().value, DisplayName = "Calendar").name,
    /*subject of the meeting*/
    TextMeetingSubject1.Text,
    /*With Teams you need to declare the structure*/
    {content: TextMeetingMessage1.Text, contentType: "html"},
    /*TimeZone*/
    "Eastern Standard Time",
    /*meeting start time*/
    {dateTime: _selectedMeetingTime.StartTime},
     /*meeting end time*/
    {dateTime: _selectedMeetingTime.EndTime},
    /*IS this an online meeting? Don't change this*/
    true,
    /*don't change this either*/
    "teamsForBusiness",
    //attendees
    {requiredAttendees:MeetingPeopleGallery1.Selected.UserPrincipalName}
)

If it works without errors, but you don't see the meeting appear in your diary - maybe check from a day before to a day after, just in case there are timezone conversion issues somewhere, but otherwise it should work.

 

Hope this helps,

RT

bhanney2323
Resolver I
Resolver I

So this works for the time issue, but now I'm actually getting a different error, saying Calendar id is an invalid parameter. I don't see how this can be true because I live in the states and it should just be Calendar right? 

bhanney2323
Resolver I
Resolver I

Found out what the issue was with calendarid, I had to remove the office365outlook connector and add it back

Hi @bhanney2323 ,

Actually, all it's looking for there is a string representation of your calendar name - for Outlook this is generally "Calendar" for the user's primary calendar, so you can drop the O365Outlook call altogether and just put "Calendar";

Set(requestOutput, MicrosoftTeams.CreateTeamsMeeting(
    /*Uses calendar, dont change*/
    "Calendar",
    /*subject of the meeting*/

More efficient and might even make it a touch faster 😊

Kind regards,

RT

Muganga
Frequent Visitor

Hi guys...I'm still facing issues related to date format.

Could someone help me out.

 

MicrosoftTeams.CreateTeamsMeeting(
"Calendar",
"Testing",
{content: "Body", contentType:"html"},
"E. South America Standard Time",
{dateTime: Text(Now(),"[$-en-US]yyyy-mm-ddThh:mm:ss")},
{dateTime: Text(Now(),"[$-en-US]yyyy-mm-ddThh:mm:ss")},
true,"TeamsforBusiness"
)

 

 

teams.PNG

 

Tks in advance

Hi Russel,

 

I am trying to implement your solution in my PowerApps App. However I need you to explain to me below point:

1-) How can I get the {dateTime: ?? }:

For example: in one of the App screens i have inserted 2 text inputs named: (MeetingSubject and MeetingMessage), 1 date picker named: (MeetingDate), 4 dropdowns to present the hours and minutes named (MeetingHour and MeetingMinute), (MeetingEndHour and MeetingEndMinute) and one combobox to search for the users in office365Users and its named: (Attendances).

On the on select property i used below function but it didn't work:

MicrosoftTeams.CreateTeamsMeeting(
"Calendar",
MeetingSubject.Text,
{content: MeetingMessage.Text, contentType:"html"},
"Arab Standard Time",
{dateTime: Text(MeetingDate.SelectedDate + Time(Value(MeetingHour.Selected.Value), Value(MeetingMinute.Selected.Value), 0))},
{dateTime: Text(MeetingDate.SelectedDate + Time(Value(MeetingEndHour.Selected.Value), Value(MeetingEndMinute.Selected.Value), 0))
},
true,
"TeamsforBusiness",

{requiredAttendees:Attendances.Selected.DisplayName}

)

 

 

AboHajer_0-1644416648461.png

2-) The {requiredAttendees:Attendances.Selected.DisplayName} accepted only this format but when i used 

{requiredAttendees:Attendances.Selecteditems.DisplayName} it shows an error and didn't work. How can i make it work to invite more than one person.

 

Waiting your support..

 

Thank you

 

 

 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,259)