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 / Handling Locked File I...
Power Automate
Unanswered

Handling Locked File Issue in SharePoint is taking a lot of time.

(0) ShareShare
ReportReport
Posted on by 145
Hi guys ,
 
I am trying to delete a sharepoint file and creating a new file with same name in sharepoint. I initially encountered the FileLocked issue. For which I eventually used this. Now the problem is when i was running the flow manually , usually i had to wait only 12 mins or so for the sharepoint point file to Unclock. But now i used this way , and its taking almost an hour to run. 
Its unbelievable. Why is it happening. Please help. @WarrenBelz
The Do Until loop properties. .png
Categories:
I have the same question (0)
  • vipuljain03 Profile Picture
    673 Super User 2026 Season 1 on at
    Approach 1:
    It seems you are using a global/generic variable and setting that variable inside your Do Until loop. Instead, use the actual SharePoint file status, such as:
    • Using the Get File Metadata action to retrieve file properties like "IsLocked".
    • Exit the loop immediately when the file is no longer locked.

    Approach 2:
    Instead of attempting deletion immediately, check the file's lock status using HTTP requests or Get File Metadata and proceed only when the file is unlocked.
     
    Approach 3:
    You can configure Retry Policy on the "Delete file" action in Power Automate.
     
    Lastly, also check that your file should not be open in a browser or application (Word/Excel). Also check for any concurrent process accessing your file.
     
    ---------------------------------------------------------------------------------
    If this reply helped you, please mark this reply as suggested answer and give it a like to help others in the community find the answer too!
     
    Thanks,
    Vipul
  • P1999 Profile Picture
    145 on at
    Hi @vipuljain03 , can you provide some link where I can refer the steps. I tried using Sharepoint API to determine if the file is locked or not. But it gave errors. I haven't used Sharepoint API 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

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 816

#2
Valantis Profile Picture

Valantis 603

#3
Haque Profile Picture

Haque 566

Last 30 days Overall leaderboard