cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RichardHy
New Member

Create a flow that deletes a calendar event

Hi, I'm using a Sharepoint add-in that manages time off, the add-in creates a Sharepoint list/calendar where the time off entries are stored, I am using a flow where it then enters these into an Outlook calendar using a "Sharepoint when an item is created" trigger and then an "Outlook create an event" action.

 

What I want to do is create a flow where it will delete the calendar entry if it is deleted from the Sharepoint list. The only availble sharepoint attrbute available to the When an item is deleted trigger is ID, so I have stored the ID in the body of each event when they are created (with no other text).

 

My current idea for a flow would be somehting like:

  1. When an Item is deleted
  2. Initialise variable
  3. Get events V4
  4. Store Get events into an array (not sure if it will store all aspect or I can stipulate just body and ID
  5. use Html to text to convert the body to text for each body part of the variable in the array
  6. use filter array to filter the array by matching the sharepoint ID attribute to the body of the event
  7. then use the output of that in delete event

Can anyone give me an example of how this could be done, I've done a lot of Googling and tried different configurations and I'm a bit stuck as I'm not proficient in Power Automate.

 

Thanks In advance for any help!

 

Rick

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @RichardHy,

 

Please refer to the following steps to approach that:

1.  Create a trigger when an item is deleted;

2. Get Events;

3. Apply to each action + HTML to text action, loop events, and convert their body to text;

4. Create a condition action, check if the body equals to the deleted item ID (this part should convert the integer ID to a String ID):

string(triggerOutputs()?['body/ID'])

5. If yes, delete the event by using Event ID get from the Get events.

Screenshot 2021-01-15 144818.jpg

 

Screenshot 2021-01-15 144931.jpg

 

Best Regards,
Community Support Team _ Lin Tu
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

3 REPLIES 3
v-litu-msft
Community Support
Community Support

Hi @RichardHy,

 

Please refer to the following steps to approach that:

1.  Create a trigger when an item is deleted;

2. Get Events;

3. Apply to each action + HTML to text action, loop events, and convert their body to text;

4. Create a condition action, check if the body equals to the deleted item ID (this part should convert the integer ID to a String ID):

string(triggerOutputs()?['body/ID'])

5. If yes, delete the event by using Event ID get from the Get events.

Screenshot 2021-01-15 144818.jpg

 

Screenshot 2021-01-15 144931.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-litu-msft thanks so much for the great reply/solution works perfectly!

molinax
Frequent Visitor

 

string(triggerOutputs()?['body/ID'])

 

@v-litu-msft: That made my day. Thanks so much.

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.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (2,943)