web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Is that possible to us...
Power Automate
Unanswered

Is that possible to use flow/automation to delete file version history in document library it created by specific account?

(0) ShareShare
ReportReport
Posted on by 4

Hi all,

 

So far our ENV has a large document library with over 10, 000 files, each file is associated with over hundreds version history, wondering there is way to get rid of version histories for each files, which is created by specific account by using flow automation? 

 

Thanks in advance

 

Rose

Categories:
I have the same question (0)
  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    Well instead of deleting the version, I suggest you just turn off version history.

    Enable and configure versioning for a list or library (microsoft.com)

    I think Powershell will be a better choice for something like this.

    SharePoint Online: How to Enable Versioning on a Document Library using PowerShell? - SharePoint Diary

     

  • RoseW2022 Profile Picture
    4 on at

    Hi SudeepGhatakNZ,

     

    Thanks for your quick feedback, but our business needs version history to track all records, we just need to get rid of some version history is generated daily by specific account. Is there flow can make this happen?

     

    thanks,

     

  • SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at

    You don't need to turn off versioning completely. You can specify how many versions you want to retain.

    I don't think there is an Out of box action that will let you delete versions. Even the SharePoint REST API only lets you get or restore versions.

    A quick search shows some premium action that might allow you to do that

    SudeepGhatakNZ_0-1665005764890.png

     

  • okeks Profile Picture
    802 Super User 2024 Season 1 on at

    I haven't tried it myself but there seems to be a way to delete a specific version if you know the version number unsing the Sharepoint API with the Send HTTP request to Sharepoint.

     

    REST API end point for deleting specific version of a SharePoint Document - Microsoft Q&A

  • RoseW2022 Profile Picture
    4 on at

    Hi Okeks and SudeepGhataNZ,

     

    Let me recap my objective, since we have lots version history is generated by four specific accounts every day, wondering is flow can get rid of those unnecessary version history records to save storage space by running every weekly or monthly, quarterly?

     

    thanks in advance.

     

    Rose

     

     

  • BS-14012031-0 Profile Picture
    2 on at
    Rose2022, did you find a solution to this, I'd be interested to know how you solved it.
  • Suggested answer
    David_MA Profile Picture
    12,966 Super User 2025 Season 2 on at
    As others have said, I don't believe you can directly do this with a flow. However, if you enable in-place records management on the site, you can then create an information management policy to delete the versions:
     
     
    To do this, you would need to:
    1. Add a date field (e.g., Delete Versions) to your document library that is optional. 
    2. If not already enabled, go to Site Settings > Site Collection Features > In Place Records Management and activate the feature.
    3. Go to the settings of the document library and go to Library Settings > More Library Settings > Information Management Policy Settings > Document
      1. This will open the screen above. Configure the settings based on the date field you created and the time period of your choosing. 
    4. Create a Power Automate flow that triggers when an item or file is created or modified.
    5. Add a trigger condition to the flow to only run if the modified by e-mail address is the e-mail of the specific account.
    6. Then update the item that triggered the flow and populate the date field you added with the date you want the policy to run.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard