Skip to main content

Notifications

Power Automate - Building Flows
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:
  • PratikJadhav08 Profile Picture
    PratikJadhav08 84 on at
    Handling Locked File Issue in SharePoint is taking a lot of time.
    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. 
  • vipuljain03 Profile Picture
    vipuljain03 166 on at
    Handling Locked File Issue in SharePoint is taking a lot of time.
    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

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,445

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,741

Leaderboard