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 / 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 84
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
Categories:
I have the same question (0)
  • vipuljain03 Profile Picture
    657 Super User 2025 Season 2 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
  • PratikJadhav08 Profile Picture
    84 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

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard