cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jrath
Frequent Visitor

SharePoint trigger - when a file is deleted

Issue: We have a SharePoint site that has many libraries, each library has many folders, each folders is actual a GUID to a D365 CE case. We have a custom field on the case which records the number of attachments uploaded to a case. The OOB process moves these attachments from the D365 CE database to the correct SharePoint folder for the case. I have a flow that updates the custom field when a file is added to the library. However, I’m trying to use the trigger above, when a file is removed, but it will not provide all of the data required to update the field.

Data proved by trigger:

"body": {

                                "ID": 1341,

                                "Name": "ErrorDetails (29)",

                                "FileNameWithExtension": "ErrorDetails (29).txt",

                                "DeletedByUserName": "User Name",

                                "TimeDeleted": "2021-02-16T19:14:45Z",

                                "IsFolder": false

                }

data missing: is the folder for the file.

Question 1: Is this all of the data provided by this trigger or are there other permissions required to return more data? If so, what permissions are required to determine the folder the file was in prior to it being deleted?

Question 2: If no other data may be returned by this trigger is there another option to get this data?

1 REPLY 1
Gopala_Krishna
Super User
Super User

@jrath 

The above mentioned JSON is all of the data provided by the trigger, this is not related with the permissions and the JSON will remain the same though you update any permissions as this is the default designed by Microsoft.

 

For more information about the outputs of the trigger action, please check the link - SharePoint - Connectors | Microsoft Docs

 

The other action that I think might help in this scenario is "For a selected item" this might sound a little odd where user instead of doing a delete has to click on the flow icon and run the flow for deletion but this way you can capture in which folder the file was present before doing the delete step.

 

Steps --> For a selected item --> Get file details --> Store the file and folder info --> Delete the file

 

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

if the information shared helps you, please consider giving a thumbs up 👍 and mark solution as resolved

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!

Users online (1,993)