Today I had a look at the SharePoint connector in Power automate and there are two when a file and when an item is deleted triggers.
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.