Skip to main content

Notifications

Power Automate - General Discussion
Suggested answer

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

  • Suggested answer
    David_MA Profile Picture
    David_MA 8,884 on at
    Is that possible to use flow/automation to delete file version history in document library it created by specific account?
    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.
  • BS-14012031-0 Profile Picture
    BS-14012031-0 2 on at
    Is that possible to use flow/automation to delete file version history in document library it created by specific account?
    Rose2022, did you find a solution to this, I'd be interested to know how you solved it.
  • RoseW2022 Profile Picture
    RoseW2022 4 on at
    Re: Is that possible to use flow/automation to delete file version history in document library it created by specific account?

    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

     

     

  • okeks Profile Picture
    okeks 802 on at
    Re: Is that possible to use flow/automation to delete file version history in document library it created by specific account?

    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

  • SudeepGhatakNZ Profile Picture
    SudeepGhatakNZ 14,231 on at
    Re: Is that possible to use flow/automation to delete file version history in document library it created by specific account?

    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

     

  • RoseW2022 Profile Picture
    RoseW2022 4 on at
    Re: Is that possible to use flow/automation to delete file version history in document library it created by specific account?

    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
    SudeepGhatakNZ 14,231 on at
    Re: Is that possible to use flow/automation to delete file version history in document library it created by specific account?

    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

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard