web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send an Email to File ...
Power Automate
Suggested Answer

Send an Email to File Creator when File is Deleted from SharePoint Document Library Folder

(0) ShareShare
ReportReport
Posted on by 16
Hi All! Assistance is much appreciated!
 
I have seen multiple posts and answers for similar issues, but none that solve for my exact problem. I just cannot get it to work.
 
I have a folder inside a SharePoint Document Library. Many people place files in this folder. When a file is deleted from the folder, I would like to send an email to the Creator of that file. 
 
I have tried When a file is deleted and entered my Site Address. Library Name and Advanced Parameter Folder, as well as combinations of Send an HTTP request to SharePoint, Initialize Variable, Filter Array and Send an email notification (V3) but cannot get all the right data into the right fields and am not sure how to have the flow identify the creator of the file that was deleted. 
 
Can you please help?
 
Thank you!
 
 
Example Document Library/Folder Setup:
 
SharePoint Site > "Document Library" > "Sample Folder"
 
Example Folder Columns:
 
I have the same question (0)
  • Suggested answer
    CH-19030305-1 Profile Picture
    2 on at
    Is it because the file has been deleted so querying the file to get the creator is no longer possible?
     
    I have not used this trigger before but it seems the trigger doesn't return you the creator of the file but the person who deleted it.
     
    If that's true, a possible walk-around is to create an inventory list to capture the file's metadata (ID etc) and the creators, using a separate flow, and then in the case when the deletion is triggered, use the file's metadata from the trigger to match the inventory list and find the creator.
  • EH-19031246-0 Profile Picture
    16 on at
    @CH-19030305-1 I forgot to mention that I did try to use the "Get file metadata" action as well, and it did not return any data. I may be using it wrong.
  • Suggested answer
    David_MA Profile Picture
    14,956 Super User 2026 Season 1 on at
    The When a file is deleted action returns minimal information about the file being deleted. It includes:
     
    Since created by is not included in this information, you will not be able to e-mail the person who created the file. And since the file has been deleted, you cannot use another action to get the properties of the file. The file would need to be restored from the recycle bin to get this information.
     
  • EH-19031246-0 Profile Picture
    16 on at
    @David_MA Hello! I have seen several posts about how to do this same thing for List items that have been deleted, by using Send an HTTP request to SharePoint to query the recycle bin: I just don't know how to apply what I have seen for Lists to Document Libraries. I will keep looking, thanks!
  • David_MA Profile Picture
    14,956 Super User 2026 Season 1 on at
    @EH-19031246-0 the HTTP request probably uses the SharePoint API. Post a link to what you saw, and someone may be able to guide you in what to do. I can get you this far to get a list of items in the recycle bin, but then I am not sure what you would do to find the corresponding item based on what is returned with the action when an item is deleted. But, once you know how to list the items in the recycle bin, maybe you'll figure something out.
     
    1. Add a SharePoint Send an HTTP Request to SharePoint
      1. Point the action to the SharePoint site where the item was deleted.
      2. Set it to a GET response for the method
      3. Enter the following in the URI field: _api/web/recyclebin
    2. Add a Parse JSON action to the flow
      1. For the content, use the body from the HTTP request action.
      2. Use the scheme below or generate your own scheme from sample data.
    3. ​​​​​​​You will then need to add an apply to each action pointed to the Body results from the Parse JSON action. You will then be to see various details about each item deleted including the author.
      1. ​​​​​​​You'll probably need to use a filter on the items returned in the recycle bin to get the item that corresponds to the item that was deleted, I am just not sure what you would filter on.
    The flow will look like this to get the recycle bin items:
     
    ​​​​​​​
    {
        "type": "object",
        "properties": {
            "d": {
                "type": "object",
                "properties": {
                    "results": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "__metadata": {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "string"
                                        },
                                        "uri": {
                                            "type": "string"
                                        },
                                        "type": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "Author": {
                                    "type": "object",
                                    "properties": {
                                        "__deferred": {
                                            "type": "object",
                                            "properties": {
                                                "uri": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                },
                                "DeletedBy": {
                                    "type": "object",
                                    "properties": {
                                        "__deferred": {
                                            "type": "object",
                                            "properties": {
                                                "uri": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                },
                                "AuthorEmail": {
                                    "type": "string"
                                },
                                "AuthorName": {
                                    "type": "string"
                                },
                                "DeletedByEmail": {
                                    "type": "string"
                                },
                                "DeletedByName": {
                                    "type": "string"
                                },
                                "DeletedDate": {
                                    "type": "string"
                                },
                                "DeletedDateLocalFormatted": {
                                    "type": "string"
                                },
                                "DirName": {
                                    "type": "string"
                                },
                                "DirNamePath": {
                                    "type": "object",
                                    "properties": {
                                        "__metadata": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string"
                                                }
                                            }
                                        },
                                        "DecodedUrl": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "Id": {
                                    "type": "string"
                                },
                                "ItemState": {
                                    "type": "integer"
                                },
                                "ItemType": {
                                    "type": "integer"
                                },
                                "LeafName": {
                                    "type": "string"
                                },
                                "LeafNamePath": {
                                    "type": "object",
                                    "properties": {
                                        "__metadata": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string"
                                                }
                                            }
                                        },
                                        "DecodedUrl": {
                                            "type": "string"
                                        }
                                    }
                                },
                                "Size": {
                                    "type": "string"
                                },
                                "Title": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "__metadata",
                                "Author",
                                "DeletedBy",
                                "AuthorEmail",
                                "AuthorName",
                                "DeletedByEmail",
                                "DeletedByName",
                                "DeletedDate",
                                "DeletedDateLocalFormatted",
                                "DirName",
                                "DirNamePath",
                                "Id",
                                "ItemState",
                                "ItemType",
                                "LeafName",
                                "LeafNamePath",
                                "Size",
                                "Title"
                            ]
                        }
                    }
                }
            }
        }
    }​​​​​​​
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard