0

I have created an approval flow that confirms the deletion of any file from a document library. When a file is deleted it will send an approval email to the approval user to approve/ reject the deletion.

When he rejects it should put back the file into the document library. when the flow comes to restore the file from the Recycle Bin it does not execute this step. !

here is my workflow:

enter image description here

2 Answers 2

0

Agree with Akshay's opinion, you will need the recycle bin item id to call the http request.

First you need to call the rest Api to get the ID and use that id to restore. I tested and succeed. enter image description here

3
  • I have used the HTTP request GET method to get the JSON body. Can you explain more. How to use the REST API? Commented Sep 24, 2020 at 9:22
  • @FatimahMohmmed, you will need to call the rest api to get the ID in recycle bin. Just use the uri :/_api/web/recycleBin, you can get the item id in Recycle bin like I do in the screenshot. Notice: it is different with GUID, that is a unique id in recycle bin.
    – Jerry_MSFT
    Commented Sep 24, 2020 at 9:25
  • I have tried what you have mentioned. But still does not work. But while checking I found that the array body output is null. Also, the JSON output body has different files deleted from different libraries. Commented Sep 26, 2020 at 17:06
0

Instead of deleting file and than restoring it back, it would make more sense to remove this file from library after Approval. If you don't want to display the file just create a column e.g. PendingForDeletionApproval and filter the View based on that. Once it is approved you can remove from Library as well as recycle bin if needed.

Now to answer your issue why the file is not restored. Its not clear from your screenshot but I assume the ID parameter you are using for Restore is the from Document library, while the API needs item ID from Recycle bin which is not same as that of document library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.