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

Delete Calendar Item via PowerApps

Hi All! TLDR: I'm 100% a novice at Power Apps and everything I've done so far has been with the power of Google.

 

That being said, we imported the Desk Booking app template from here and I've been modifying it to create a meeting invitation (successfully) using Shane Young's video. Now I'm struggling to figure out how to cancel the meeting invitation in Outlook when you press the "Cancel" button.

 

I'm appending the Office365Outlook.CalendarDeleteItemV2 connector to "OnSelect" of the "Cancel" button. My problem is that I don't fully understand how to make it look up the specific event that I'm trying to cancel. What I've got so far is:

 

Office365Outlook.CalendarDeleteItemV2(LookUp(Office365Outlook.CalendarGetTables().value,DisplayName = "Calendar").Name,event)

 

It's looking up the correct calendar, but doesn't know what event to cancel. My Google powers are failing me on finding a tutorial or information on how to properly use the CalendarDeleteItemV2 to find the correct event.

 

My apologies if I'm not using the right phrasing on this, I'm 1.5 weeks into using Power Apps and trying to "figure it out." Any help would be appreciated!

2 ACCEPTED SOLUTIONS

Accepted Solutions

I solved it by using a nested data table instead of nested gallery and changed the delete code to

Office365Outlook.CalendarDeleteItemV2(LookUp(Office365Outlook.CalendarGetTablesV2().value,name="Calendar").id,DataTable7.Selected.id);

View solution in original post

Smilee279
Resolver I
Resolver I

I ended up doing something very similar.  On the OnSelect of the cancel button:

Set(MyCalendarID,LookUp(Office365Outlook.CalendarGetTables().value,DisplayName = "Calendar").Name);
Office365Outlook.CalendarDeleteItemV2(MyCalendarID,ThisItem.OutlookEventID);
Remove('Desk Reservations',ThisItem)

 

View solution in original post

7 REPLIES 7
VijayTailor
Resident Rockstar
Resident Rockstar

Hi,

You can Use Like that.

Office365.CalendarDeleteItemV2(Dropdown1.Selected.id, ThisItem.Id);

In Place of DropDown, you can Pass Your Properties or you can use your logic.

But for Remove the Meeting required Name and ID.

For reference, you can have a look into the below URL.
https://powerusers.microsoft.com/t5/Building-Power-Apps/Delete-Cancel-Meeting-Room/td-p/364201

Hope this solution helps you to resolve your issue.

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

So, let me break this down to where I'm stuck:

 

Office365.CalendarDeleteItemV2(Dropdown1.Selected.id, ThisItem.Id);

For the underlined part, I planned to use  

(LookUp(Office365Outlook.CalendarGetTables().value,DisplayName = "Calendar").Name

For the below underlined part "ThisItem.Id" is where I'm struggling.

Office365.CalendarDeleteItemV2(Dropdown1.Selected.id, ThisItem.Id);

If I put in "ThisItem.ID" or "ThisItem.Identity" the app errors out--I'm guessing because it's not calling the correct Outlook event.

Here's what the code looks like:

Select( Parent );
Remove('Desk Reservations',ThisItem);
Office365Outlook.CalendarDeleteItemV2
     (LookUp(Office365Outlook.CalendarGetTables().value,DisplayName="Calendar").Name,ThisItem.ID)

I've attached the error message I get.  

 

Hi,

As per the below comments.

 

I tested and Mode few changes.

Please Use

Below Code for Delete the Events/Meeting Like below.

Set(CalendarDatails,LookUp(Office365Outlook.CalendarGetTables().value,DisplayName=ComboBox4.Selected.DisplayName));

Office365Outlook.CalendarDeleteItemV2(CalendarDatails.DisplayName,ThisItem.id);

 

For getting the Gellary Item you can use like below
Office365Outlook.V4CalendarGetItems(ComboBox4.Selected.Name).value

VijayTailor_0-1601017078051.png

 

 

Thanks,
Hope this time your issue is resolved.

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Please vote for my idea if you feel, that will help you in the future or good to have in power app.
https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Ability-s-to-Select-Icon-from-UIFabric/idi-p/69...

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/Preview-Mode-for-All-the-Device-Like-Phone-Tabl...






Unfortunately, those suggestions didn't work, either.  I'm thinking about attacking this from a different angle and having it save the eventID to Sharepoint when it creates the meeting invite.  Then when sending the cancellation, I can reference the eventID.  Now I just have to figure out how to do all that.... but I think that might be the best route.  

BlessedCobba
Resolver I
Resolver I

I'm going to spin this back up and see if anyone has solved it.

 

I tried to solve it with a nested gallery. was able to find the calendar ID related to the desk booking, however i was unable to reference the ID in the nested gallery


Nested Gallery looking up the calendar and fetching the ID that matches the booking

BlessedCobba_0-1631673474728.png

 

 

Filter(Office365Outlook.V4CalendarGetItems("Calendar").value, subject = ThisItem.DeskText And startWithTimeZone = ThisItem.CheckOutFrom And endWithTimeZone = ThisItem.CheckOutTo)

 

 

then the cancel button i have tried to delete the calendar item with

 

 

Office365Outlook.CalendarDeleteItemV2(LookUp(Office365Outlook.CalendarGetTablesV2().value,name="Calendar").id,Calendar_ID.Text);

 

 

i am hitting and error referencing the Calendar_ID.Text inside the nested gallery

BlessedCobba_1-1631673626569.png

 

Everything works if the gallery is not nested and i just hard code the values to look up.
How can i reference a text field inside a nested gallery? it just comes up blank?

I solved it by using a nested data table instead of nested gallery and changed the delete code to

Office365Outlook.CalendarDeleteItemV2(LookUp(Office365Outlook.CalendarGetTablesV2().value,name="Calendar").id,DataTable7.Selected.id);

View solution in original post

Smilee279
Resolver I
Resolver I

I ended up doing something very similar.  On the OnSelect of the cancel button:

Set(MyCalendarID,LookUp(Office365Outlook.CalendarGetTables().value,DisplayName = "Calendar").Name);
Office365Outlook.CalendarDeleteItemV2(MyCalendarID,ThisItem.OutlookEventID);
Remove('Desk Reservations',ThisItem)

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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