Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

Like (0) ShareShare
ReportReport
Posted on 18 Oct 2022 21:27:40 by 10

I am trying to delete a file from the trash using an HTTP request but I get the following error "{" odata.error ": {" code ":" - 1, Microsoft.SharePoint.Client.InvalidClientQueryException "," message ": {" lang ":" en-US "," value ":" The type SP.RecycleBinItemCollection does not support HTTP DELETE method. "}}}
clientRequestId: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx":

 

Immagine.png

is there any other solution to empty the recycle bin or permanently delete a file without going through the first and second level recycle bin?

  • ChrisSullivan Profile Picture
    101 on 29 Mar 2024 at 13:43:52
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    Still having the same issue with that
    Value is still empty

     

    _api/web/RecycleBin?$filter=Title eq 'Test delete item from recycle bin if deleted before moving'&$select=Id


    Screenshot 2024-03-29 094253.jpg

     

  • Expiscornovus Profile Picture
    31,510 Most Valuable Professional on 28 Mar 2024 at 11:48:26
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    Hi @ChrisSullivan,


    In the example I shared earlier the query was looking for a file, not a list item. That filter was using the LeafName property.

     

    In your case it is a Title of list item you are using in your filter. In that case try and use the Title property in the filter instead.

     

    _api/web/RecycleBin?$filter=Title eq '@{triggerOutputs()?['body/Name']}'&$select=Id

     

    listitem_deleted.png

     

  • ChrisSullivan Profile Picture
    101 on 27 Mar 2024 at 17:17:30
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    Hi there. 

    This is not working for me. I am trying to delete a list item from the recycle bin after it is delete. 

    I am using 

    "When an Item is Deleted" trigger and the dynamic content "FileNameWithExtention" for the LeafName.

    _api/web/RecycleBin?$filter=LeafName eq'Test delete item from recycle bin if deleted before moving'&$select=Id

    It is not pulling the ID from the Item....?
    Screenshot 2024-03-27 131422.jpg

     

    What might I be doing wrong?

  • pcamida Profile Picture
    9 on 15 May 2023 at 09:18:07
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    Any solution for users No Business (no Sharepoint) to empty automatically the recycle bin?

  • pcamida Profile Picture
    9 on 14 May 2023 at 11:38:11
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    Thank you very much!! It's very simple but it's working. Now, I can empty automatically my recycle bin every day.

  • pcamida Profile Picture
    9 on 08 May 2023 at 09:39:15
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    Thanks for the solution! Can someone share the whole flow to copy-paste? I want to delete all items, empty recycle bin without exception. Thank you very much!

     

  • VictorIvanidze Profile Picture
    12,184 on 09 Jan 2023 at 09:19:56
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    Show your flow. Do you see any errors?

  • AEES Profile Picture
    13 on 08 Jan 2023 at 19:26:55
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    Hi,
    Could you share the entire PA flow you used? Trying to empty recycle bin like very 5-10 days but cant get it working properly after some test.

  • VASYL_MELNYK Profile Picture
    8 on 11 Nov 2022 at 20:21:54
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    Hi.

     

    https://learn.microsoft.com/en-us/previous-versions/office/sharepoint-visio/jj246426(v=office.15)

     

    POST http://<sitecollection>/<site>/_api/web/RecycleBin/deleteAll()
    use "Send an HTTP request to SharePoint" for POST
    VASYL_MELNYK_0-1668198051063.png

     

  • stefanofondaz Profile Picture
    10 on 19 Oct 2022 at 10:34:17
    Re: Use Power Automate to permanently delete files from a folder or recycle bin - OneDrive Business

    it works!!!!! thank u so much 😍

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,710 Most Valuable Professional

Leaderboard
Loading started