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

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

6 REPLIES 6
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
Helper III
Helper III

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

View solution in original post

bhanney2323
Helper III
Helper III

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
Helper III
Helper III

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

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 (66,776)