cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WatermelonCat
Helper I
Helper I

Add and remove events on calendar screen

I added a calendar screen to my app but I want a function that allows the user to add an event to the calendar and a function that will allow the user to delete an event to the calendar. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @WatermelonCat ,

Could you please share a bit more about your scenario?

Do you want to add event or delete event within the Calendar screen?

 

Based on the needs that you mentioned, I think you need to customize your Calendar screen app. I have made a test on my side, please consider take a try with the following workaround:

5.JPG

 

6.JPG

 

7.JPG

Within your Calendar screen, add a "Remove" Icon within the CalendarEventsGallery1, set the OnSelect property to following:

Office365Outlook.CalendarDeleteItemV2(dropdownCalendarSelection1.Selected.Name, ThisItem.Id);
ClearCollect(MyCalendarEvents, Office365Outlook.GetEventsCalendarViewV2(_myCalendar.Name, Text(_minDate, UTC), Text(_maxDate, UTC)).value);

 

Add a "+" icon within the Header bar, set the OnSelect property to following:

Navigate('New Event Screen')

 

Within your 'New Event Screen', add a "Add" button, set the OnSelect property to following:

Office365Outlook.V2CalendarPostItem(
                                   CalendarDropdown.Selected.Name, 
                                   SubjectBox.Text, 
                                   Text(StartDatePicker.SelectedDate + Time(Value(StartHour.Selected.Value), Value(StartMinute.Selected.Value),0), "[$-en-US]yyyy-mm-ddTHH:mm:ssZ"), 
                                   Text(EndDatePicker.SelectedDate + Time(Value(EndHour.Selected.Value), Value(EndMinute.Selected.Value),0), "[$-en-US]yyyy-mm-ddTHH:mm:ssZ"),
                                  {
                                       TimeZone:"(UTC+08:00) Kuala Lumpur, Singapore",  /* <-- Specify your own local Time Zone value here */
                                       Body: BodyBox.Text
                                  }
);
ClearCollect(MyCalendarEvents, Office365Outlook.GetEventsCalendarViewV2(_myCalendar.Name, Text(_minDate, UTC), Text(_maxDate, UTC)).value);

 

Please take a try with above solution, check if the issue is solved. Please check the attached sample app for help.

 

Best regards,

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 @WatermelonCat ,

Could you please share a bit more about your scenario?

Do you want to add event or delete event within the Calendar screen?

 

Based on the needs that you mentioned, I think you need to customize your Calendar screen app. I have made a test on my side, please consider take a try with the following workaround:

5.JPG

 

6.JPG

 

7.JPG

Within your Calendar screen, add a "Remove" Icon within the CalendarEventsGallery1, set the OnSelect property to following:

Office365Outlook.CalendarDeleteItemV2(dropdownCalendarSelection1.Selected.Name, ThisItem.Id);
ClearCollect(MyCalendarEvents, Office365Outlook.GetEventsCalendarViewV2(_myCalendar.Name, Text(_minDate, UTC), Text(_maxDate, UTC)).value);

 

Add a "+" icon within the Header bar, set the OnSelect property to following:

Navigate('New Event Screen')

 

Within your 'New Event Screen', add a "Add" button, set the OnSelect property to following:

Office365Outlook.V2CalendarPostItem(
                                   CalendarDropdown.Selected.Name, 
                                   SubjectBox.Text, 
                                   Text(StartDatePicker.SelectedDate + Time(Value(StartHour.Selected.Value), Value(StartMinute.Selected.Value),0), "[$-en-US]yyyy-mm-ddTHH:mm:ssZ"), 
                                   Text(EndDatePicker.SelectedDate + Time(Value(EndHour.Selected.Value), Value(EndMinute.Selected.Value),0), "[$-en-US]yyyy-mm-ddTHH:mm:ssZ"),
                                  {
                                       TimeZone:"(UTC+08:00) Kuala Lumpur, Singapore",  /* <-- Specify your own local Time Zone value here */
                                       Body: BodyBox.Text
                                  }
);
ClearCollect(MyCalendarEvents, Office365Outlook.GetEventsCalendarViewV2(_myCalendar.Name, Text(_minDate, UTC), Text(_maxDate, UTC)).value);

 

Please take a try with above solution, check if the issue is solved. Please check the attached sample app for help.

 

Best regards,

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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,527)