Microsoft Flow – New!! – When a file or item is deleted triggers

Microsoft Flow Connector

Today I had a look at the SharePoint connector in Microsoft Flow and there are two new trigger and one new action.

When a file is deleted

In this post I’m going to have a look at the “When a file is deleted” trigger.

Then when you look at the information available after this action within the dynamic content, it is easy to find out which file was deleted and who deleted the file. It is even possible to find out when it was deleted.

Although it isn’t possible to undelete the file or to get to the content of the file at least you can now trigger  process that you would like to start on deletion of a document.

Both of these  Dynamic content options give you the data you would expect. Also note that the ID of the document is given! This ID can also be retrieved then you use a variable of the type Integer

Looking at the name of the dynamic content “List of Deleted items”, I would have expected that deleting multiple documents would only trigger one flow. This however is not the case. When you delete multiple documents you only get one document listed in each flow and multiple flows will be started.

Deleted By username displays the user’s display name rather than their user login. I’m not sure if this could cause problems, but it is at least something to be aware of.

Then I tried deleting folders and this trigger even handles the deletion of folders within your library. in short this looks like a nice improvement to the Flow offerings.

But this is not all! There is also a trigger for the deletion of items:

Other than handling items rather than handling files in libraries there is no real difference.

 

 

 

 

 

 

 

 

 

 

 

 

Advertisements


Categories:Flow, Microsoft Flow, Office 365

Tags:

10 replies

  1. Great to know it! This is something that I missed several times!

    Like

  2. Hello, great article!

    Upon delete of an item in the SharePoint calendar I want this item also deleted from the users calendar via Microsoft Flow. I followed this guide to create a Flow to have the item added or modified, which works great:

    hxxps://powerusers.microsoft.com/t5/Building-Flows/SharePoint-Calendar-and-Events/m-p/121418#M11799

    But now I want to also create a Flow to delete an item if it’s deleted from SharePoint.

    I found the “When an item is deleted” action but I’m stuck, the Get Item action can’t be used because the item is already deleted.

    Please assist, it will be greatly appreciated!

    Like

    • “But now I want to also create a Flow to delete an item if it’s deleted from SharePoint.”

      And here I mean:

      But now I want to also create a Flow to delete a calendar item from the users calendar if it’s deleted from a SharePoint Calendar.

      Like

    • Hi Andries,

      All the deleted item trigger gives to you is:

      {
      "ID": 10,
      "Name": "test",
      "FileNameWithExtension": "test",
      "DeletedByUserName": "Pieter Veenstra",
      "TimeDeleted": "2018-06-04T12:34:31Z",
      "IsFolder": false
      }

      And indeed it is not possible to get to the data of the deleted item. Therefore the only way you could identify the calendar item would be by storing the ID and Name in the calendar item somewhere.

      You could probably use the above information tho get to your deleted item in the recycle bin. I will create a post for this shortly.

      Like

      • Thank you for your quick reply! I do have a custom column in SharePoint named “outlook event id”, Outlook fill this field. ( see hxxps://powerusers.microsoft.com/t5/Building-Flows/SharePoint-Calendar-and-Events/m-p/121418#M11799) However I don’t seem to be able to use this field when using the “When an item is deleted” action?

        Like

      • Hi Andries,

        I don’t think that there is an API to get to the custom properties of the deleted items in a recycle bin.

        Like

      • Hi, very nice write up. Have you found a way to access the recycle bin with Flow? I’d like to get some more properties from the deleted file.

        Like

      • You can get to the recycle bin through the rest API ( /_api/web/RecycleBin ), however that isn’t going to give you any of the metadata that originally belonged to the document.

        Like

Trackbacks

  1. Microsoft Flow – When a file is created or modified (properties only) has been extended – SharePains

Please leave a comment or feedback

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: