Hi
I have created an app for event registration and am trying to remove events from users' calendar when they decide to cancel their registration. The code I am using is this:
Set(varUserCalendarlId,
LookUp(Office365Outlook.CalendarGetTablesV2().value,
name="Calendar").id
);
With({idCalendarEntry:
First(
Office365Outlook.GetEventsCalendarViewV3(
varUserCalendarId,
Text(DateTimeValue(StartDateTimeDataCardValue.Text,"en-GB"),DateTimeFormat.UTC),
Text(DateTimeValue(EndDateTimeDataCardValue.Text,"en-GB"),DateTimeFormat.UTC),
{search:"Auto-entry by sign-up App"}
).value
)
},
Office365Outlook.CalendarDeleteItemV2(
varUserCalendarId,
idCalendarEntry.id
)
)
I know that the code returns the correct calendar ID (I have used the same code for entering the even into participant's calendars and it works) but for some reason it does not delete the even even though I get no error messages either from PowerApps studio or when I run the app. Any ideas where the bug might be? Many thanks in advance
Update!!!
I just tried the code again and it worked fine. Thank you very much for taking the time to help and advise. Much appreciated
Thank you for your reply. Can I just double check. When you say it worked as expected, you mean it actually deleted the event from Outlook yes? If that's the case, then it is very strange that it is not working for me. Is there any alternative code I could use instead of CalendarDeleteItemV2? Is there a remove function?
Hi @Siamak ,
If you have a value, it means you indeed have the code to capture the idCalendarEntry correct.
I just tested a similar set-up and unfortunately... it's working just as expected. That means there's very little to go on in trying to support you...
Yes, I do get an ID code for idCalendarEntry which seems to be a correct one as it only shows up when there is an entry in the calendar. And thanks for you speedy reply
Hi @Siamak ,
Have you also verified you are receiving the correct idCalendarEntry? You can test this by pasting the below code in a Label:
First(
Office365Outlook.GetEventsCalendarViewV3(
varUserCalendarId,
Text(DateTimeValue(StartDateTimeDataCardValue.Text,"en-GB"),DateTimeFormat.UTC),
Text(DateTimeValue(EndDateTimeDataCardValue.Text,"en-GB"),DateTimeFormat.UTC),
{search:"Auto-entry by sign-up App"}
).value
).id
WarrenBelz
637
Most Valuable Professional
stampcoin
570
Super User 2025 Season 2
Power Apps 1919
473