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 / How to delete items in...
Power Automate
Answered

How to delete items in the second-stage bin

(0) ShareShare
ReportReport
Posted on by 261

Hello

I like to know if anybody has resolved the issue to delete data from the second-stage bin in OneDrive or SharePoint.

For the first-stage bin you would use: 

_api/web/RecycleBin

Thanks in advance 😉

Cheers

Michael

Categories:
I have the same question (0)
  • MD2024 Profile Picture
    261 on at

    ...looks like _api/site/RecycleBin  wil work as second-stage is site-collection bin 😉

  • CFernandes Profile Picture
    8,482 Most Valuable Professional on at

    Hello @MD2024 

     

    You will need to use the REST API - 

     

    Method: Delete

    Uri: _api/web/Lists/GetByTitle(‘Your list title’)/Items(<Your Item id here>)

    Headers: Add the If-Match header with the value of * to ignore the ETAG validation 

     

    CFernandes_1-1710927255272.png

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

     

    P.S. take a look at my blog here and like & subscribe to my YouTube Channel thanks.

     

  • MD2024 Profile Picture
    261 on at

    After my testing, it looks like you get all documents deleted in both bins by using _api/site/RecycleBin,

    but to seperate which one is in stage-one (UserBin) and stage-two (SiteBin) you can see in the json output of the HTTP-Request the following for stage-one-bin: "ItemState": 1  for stage-two-bin "ItemState": 2

  • CFernandes Profile Picture
    8,482 Most Valuable Professional on at

    @MD2024 Are you trying to access to other user's recycle bin in Sharepoint?

  • Verified answer
    Expiscornovus Profile Picture
    33,828 Most Valuable Professional on at

    Hi @MD2024,

     

    Don't know if it helps, but the SharePoint docs show that there seems to be a RecycleBinItemCollection.DeleteAllSecondStageItems method available.

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

     

    Can you try that?

     

    deleteallsecondstageitems.png

  • MD2024 Profile Picture
    261 on at

    Hello CFernandes

    Well I was thinking of delete by scheduler all the documents in the 2.Stage-Bin of my OneDrive.

    But found a way now.

  • MD2024 Profile Picture
    261 on at

    Well I found a way, but the one you are showing is a more simple one.

    The only is that I have implemented a switch to get at first all the documents in Site bin, 

    and run the flow again after I have checked all the items in my email are ok to delete, so switch ON 😉

    But thanks a lot and well research 😉

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 594

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 281 Super User 2026 Season 1

Last 30 days Overall leaderboard