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

Creating new event for Office 365 Groups calendar

Hello All,

 

I am trying to create an event in Office365 group calendar, below is the line of code 

 

 Office365Groups.CreateCalendarEvent(Dropdown2.Selected.id,"asd",DatePicker1.SelectedDate,DatePicker2.SelectedDate)

 

I am getting an error on dates as below : 

 

Invalid argument type (Date). Expecting a record value instead.

 

Why it is not taking the date value as the filelds are startdate and enddate for the calendar?

 

It is working fine while creating an event in personal calendar.

 

Thanks in advance..!!

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Parth,

 

Could you please share a screenshot of your app's configuration?

 

I have made a test, the issue is confirmed on my side. I think there is something wrong with the formula that you provided within your app.

 

The standard formula format of the Office365.CreateCalendarEvent() function as below:

 

Office365Groups.CreateCalendarEvent(
groupid,
subject,
start,     // it is required to fill a record rather than a date time
end,      // it is required to fill a record rather than a date time
{
  body,  // it is required to fill a record rather than a Text string
  location,  // it is required to fill a record rather than a Text string
  importance,
  isAllDay,
  isReminderOn,
  reminderMinutesBeforeStart,
  showAs,
  responseRequested
}
)

 

 

I have made a test on my side, please take a try with the following workaround:1.JPG

 

 

Set the OnSelect property of the Button control to following formula:

 

Office365Groups.CreateCalendarEvent(
Dropdown1.Selected.id,
"PowerApps Test Evemnt",
{dateTime:DatePicker1.SelectedDate,timeZone:DateTimeZone.Local},
{dateTime:DatePicker2.SelectedDate,timeZone:DateTimeZone.Local}
)

 

 

Best regards,

Kris

 

Community Support Team _ Kris Dai
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

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @Parth,

 

Could you please share a screenshot of your app's configuration?

 

I have made a test, the issue is confirmed on my side. I think there is something wrong with the formula that you provided within your app.

 

The standard formula format of the Office365.CreateCalendarEvent() function as below:

 

Office365Groups.CreateCalendarEvent(
groupid,
subject,
start,     // it is required to fill a record rather than a date time
end,      // it is required to fill a record rather than a date time
{
  body,  // it is required to fill a record rather than a Text string
  location,  // it is required to fill a record rather than a Text string
  importance,
  isAllDay,
  isReminderOn,
  reminderMinutesBeforeStart,
  showAs,
  responseRequested
}
)

 

 

I have made a test on my side, please take a try with the following workaround:1.JPG

 

 

Set the OnSelect property of the Button control to following formula:

 

Office365Groups.CreateCalendarEvent(
Dropdown1.Selected.id,
"PowerApps Test Evemnt",
{dateTime:DatePicker1.SelectedDate,timeZone:DateTimeZone.Local},
{dateTime:DatePicker2.SelectedDate,timeZone:DateTimeZone.Local}
)

 

 

Best regards,

Kris

 

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

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,260)