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

Failed to delete Calendar event using lookup

I am able to delete a calendar event if I use the event id. But the way I used to save an event id when I create a new event took  more than 1 minutes.

Here is code I used to 

Office365Outlook.V4CalendarPostItem(
// lookup user's calendar
LookUp(Office365Outlook.CalendarGetTables().value, DisplayName = "Calendar").Name,
// subject of meeting
"Work Space OPP " & workspaceNo & " reserved ",
// The time the reservation started
DateAdd(startTime, TimeZoneOffset(), Minutes),
// The time the reservation ended
DateAdd(endTime, TimeZoneOffset(), Minutes),
//The timezone for the reservation
"(UTC) Coordinated Universal Time",
);

// took more than 1 min

Set(_eventID,Last(Sort(Office365Outlook.V4CalendarGetItems(_myCalendarID).value,createdDateTime)).id); 

 

// save _eventID in SharePoint

//delete event

Office365Outlook.CalendarDeleteItemV2("Calendar", ThisItem.EventID);

 

I found somebody suggested to delete the event by using lookup instead of used the saved event id.  I couldn't get the code working when I switch to lookup

 

Office365Outlook.CalendarDeleteItemV2("Calendar", LookUp(Office365Outlook.V4CalendarGetItems("Calendar",subject=ThisItem.subject).id)2021-07-12_Delete_Event_Using_Lookup.jpg

Any idea ?  Thanks

0 REPLIES 0

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (4,041)