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

Deleting a outlook event with a button

Hi there, i have 2 buttons. one with which i create a outlook event and then i have another with which i delete a outlook event, the one creating the outlook event is working fine. it creates a event with always the same name, always from 8am to 5pm. and the location name changes depending on what u selected when creating the event.  now im trying to figure out how to find and delete this same event with the second button. anyone can help me here? i have tried using odata but it's not making much sense to me

 

available data to find the right event: 
- the location name
- the date

1 ACCEPTED SOLUTION

Accepted Solutions

Hey @WesselO 

 

That's totally fine, if you use a Power Automate Flow, you should add an action "Respond to a Power App or flow" and respense the ItemID of your created item to Power Apps:

MarvinBangert_0-1599999401535.png

In Power Apps just save the response in a variable:

MarvinBangert_1-1599999457901.png

To delete the item, you could add a button that starts another flow and you pass the correct ItemID to your flow or you could use the function I used to delete the item without using a flow.

Flow is much neater if you want to troubleshoot your process.

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

10 REPLIES 10
Resolver III
Resolver III

Hey @WesselO 

 

I used the "Office365Outlook.CalendarDeleteItemV2()" command in Power Apps to delete the item. It has the parameters "Calendar" and "Item [id]". To select the correct calendar I created a dropdown with the function "Office365Outlook.CalendarGetTablesV2().value". Displayname is "name".

This is my OnSelect-function on my button to delete items:

Office365Outlook.CalendarDeleteItemV2(Dropdown1.SelectedText.id,First(Office365Outlook.CalendarGetItems(Dropdown1.SelectedText.id).value).Id)

Because you cannot save the ID of the created item (if you do not use a Power Automate Flow), I used the "First" action to get the last created item from my calendar. Then the last created event will be deleted.

 

Hope this will help you!

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

hey @MarvinBangert

 

Thanks for your quick response, i forgot to mention i am doing this using powerflow,

the flow i create the event with looks like this, it executes on a button click in power apps:

2020-09-13 14_00_38-Edit your flow _ Power Automate.png
I made it this way cause i have people who use a different language and people who use English in their outlook app.

Would you say deleting the event using your suggested option would be better than deleting the event with a flow? 

Hey @WesselO 

 

That's totally fine, if you use a Power Automate Flow, you should add an action "Respond to a Power App or flow" and respense the ItemID of your created item to Power Apps:

MarvinBangert_0-1599999401535.png

In Power Apps just save the response in a variable:

MarvinBangert_1-1599999457901.png

To delete the item, you could add a button that starts another flow and you pass the correct ItemID to your flow or you could use the function I used to delete the item without using a flow.

Flow is much neater if you want to troubleshoot your process.

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

View solution in original post

Hey @MarvinBangert, this is giving me a lot of good ideas thank you so much!

I'm getting stuck on a little part, i'm sure im missing something simple. heres where i am trying to saving it so i can patch in the next part. ( i am saving the variable on the same button im executing the event creation, is this a problem?)

WesselO_0-1600000484447.png

this is how i implemented your suggestion in my flow, 

WesselO_1-1600000529623.png

 




Hey @WesselO 

your flow looks fine, but in your Power App, you need to add the Set()-Function around your "GenerateOutlookEvent.Run" like:

//make Outlook event
Set(_AgendaId;GenerateOutlookEvent.Run(...).EventId);

 

If you click the button, the flow is starting first and after that, it responses to your Power Automate with the EventId. This EventId is saved in the variable "_AgendaId".

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Hey @MarvinBangert,

 

for some reason its not recognizing that i have this response or something?

WesselO_0-1600002821021.png


when i push it without the .EventID, it just returns "true"

Hey @WesselO 

if you just add a dot after the run(), does Power Apps suggest you a value? Like:

MarvinBangert_0-1600003502356.png

Then just select the suggested value, if you enter the name by yourself, maybe it is not recognized as a valid response.

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

It unfortunately doesn't suggest me a value @MarvinBangert 

Have you saved your flow?

Otherwise, you maybe need to remove and readd your flow to your button (make sure you copy and save everything from your buttons OnSelect property, because everything will be removed if you readd your flow!!).

Select your button and click on "action" - "Power Automate", you should see the flows associated with your button. Click on the three dots and select "remove from app", afterwards select the same flow from the list below. After the flow is added, insert everything you saved before you deleted the flow from the button. Try again to add a dot after the run() if it suggests you the "eventId".

 

Best regards
Marvin

If you like this post, give a Thumbs up. If it solved your request, Mark it as a Solution to enable other users to find it.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,843)