Accessing SharePoint Recycle Bin using Microsoft Flows

Introduction:

This blog provides steps to follow in order to access the SharePoint Recycle Bin in MS Flows

 

Steps:

1) In Actions, select “Send an HTTP request to SharePoint”

2) Enter the below details:
Site Address: Select your site address from the list.
Method: GET
Uri:_api/web/recycleBin?$filter=DeletedDate eq datetime’Time Deleted’ and DeletedByName eq ‘Deleted by’ and Title eq ‘Filename with extension’.
Headers:
Accept application/json
Pls. Note: The parameters marked in yellow are taken from the trigger “when a file is deleted in SharePoint”

3) Select Action “Parse JSON”

4) In parse JSON, the content is the body of HTTP Response

Enter the below Schema:

{

“type”: “object”,

“properties”: {

“odata.metadata”: {“type”: “string”},“value”: {“type”: “array”,“items”: {“type”: “object”,

“properties”: {“odata.type”: {“type”: “string”},“odata.id”: {“type”: “string”},

“odata.editLink”: {“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”: {

“DecodedUrl”: {“type”: “string”}}},“Id”: {“type”: “string”},“ItemState”: {“type”: “integer”},

“ItemType”: {“type”: “integer”},“LeafName”: {“type”: “string”},

“LeafNamePath”: {“type”: “object”,“properties”: {“DecodedUrl”: {“type”: “string”}}},

“Size”: {“type”: “string”},“Title”: {“type”: “string”}},“required”: [

“odata.type”,“odata.id”,“odata.editLink”,

“AuthorEmail”,“AuthorName”,“DeletedByEmail”,

“DeletedByName”,“DeletedDate”,“DeletedDateLocalFormatted”,“DirName”,“DirNamePath”,“Id”,

“ItemState”,“ItemType”,“LeafName”,“LeafNamePath”,“Size”,“Title”]

}}}}

Sample Output:

Conclusion:

In cases where we need to get the original location of file after it is been deleted from SharePoint, we can  access Recycle Bin of SharePoint and obtain the original path.


Share Story :

SEARCH BLOGS :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange