Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Unanswered

Power Automate - Send an HTTP request to SharePoint - Preserving Deleted Files in Sharepoint

Like (1) ShareShare
ReportReport
Posted on 16 Aug 2024 01:29:59 by 6
Hello, I'm trying to emulate the flow shown below to move files that are deleted to a seperate Library instead.
It grabs the files recently added to the recycle bin, restores them, then moves them to a different library/folder.
 
 
My Issue is that the "Send an HTTP request to SharePoint" is only picking up files I have deleted, I need it to pickup the deleted files no matter who deleted them.
I have increased the "Subtract from Time" to 3 hours to check, and I can clearly see files that have been deleted by my collegues within the timeframe.
 
See URI and JSON below
 
What the full flow should look like; I had it all setup and it was working fine (for files I deleted), but for testing I've deleted all after the HTTP request for now as I can see the problem is there.
Screenshot of a Power Automate workflow for detecting a file that is being deleted on a SharePoint Online site and moving it into a custom Recycle Bin. The workflow triggers when a file is deleted, restores the file to its original location, moves it to a custom Recycle Bin, and finally adds the value of the Original Location to the file in the custom Recycle Bin.
 
 
URI;
_api/web/RecycleBin?$filter=DeletedDate ge datetime'@{body('Subtract_from_time')}'
 
JSON;
  
{
    "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"
            }
        }
    }
}

EDIT**
I am Owner of the Sharepoint Site in question so have full control there.
I am not 365 admin of any type.
If its required, I can have my boss link his 365 admin user to the flow if that would sort the issue, he is a 365 Global Administrator.
Categories:
  • ID-02091011-0 Profile Picture
    2 on 02 Sep 2024 at 10:13:43
    Power Automate - Send an HTTP request to SharePoint - Preserving Deleted Files in Sharepoint
    Use "_api/site/RecycleBin" instead of "_api/web/RecycleBin" then it should return all items. Worked for me trying to find system deleted items.
  • JB-16080034-0 Profile Picture
    6 on 16 Aug 2024 at 18:51:12
    Power Automate - Send an HTTP request to SharePoint - Preserving Deleted Files in Sharepoint
    @FLMike
     
    I am Owner of the Sharepoint Site in question so have full control there.
    I am not 365 admin of any type.
    If its required, I can have my boss link his 365 admin user to the flow if that would sort the issue, he is a 365 Global Administrator.
  • Michael E. Gernaey Profile Picture
    42,617 Super User 2025 Season 1 on 16 Aug 2024 at 17:23:22
    Power Automate - Send an HTTP request to SharePoint - Preserving Deleted Files in Sharepoint
    Hi
     
    Are you an admin?

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard >

Loading started