Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Possiblity of two handles to the same file ?

(2) ShareShare
ReportReport
Posted on by 42
I have some power automate flows.   Running quite successfully for some time.    Now, I have modified the flow.    Added a couple of checks, but generally have not modified the file attributes of the list entry.
 
Meaning, I usually just read attributes from a file;   (Sharepoint get item properties)
 
Do a bunch of checks, some calculations for field entries and the very last thing, is to write the changes to the file.  (Sharepoint Update Item)
 
The biggest stumbling block I found was waiting, or checking if the file was open.   I would attempt to write changes to said file, but error' FIle in use"
 
I did some code tweaks, and wrote a "SubProcedure" (Scope) to attempt to write to a file, if not (File in use), wait 10 and check again.  (For about 4 hours)
 
that seems to have done the trick.  I can now faithfully send file changes to the scope, and it is good.
 
Now, as of late, it is not good.
 
I am still getting the "File in use" error.   Suprisingly, from the very service account doing the work.
 
 
What is the possibility that I may have two file handles open under the same service account ?
 
How long does it take to close that darn file handle ?  (I am aware of the copy /. delete, but that wrecks a bunch of stuff)
 
IF I check if it is me (Service account), that has it open, can I force all my handles closed ?
 
 
Thoughts ?
 
 
 
 
 
 
 
  • RG-27121653-0 Profile Picture
    42 on at
    Possiblity of two handles to the same file ?
    Yea, examining the flows, it does "File not locked' after about 5-7 minutes.,
     
    The question is; 
     
    The service account has the file open to do the work already.   Its trying to write to the same file a few moments later and get a "File locked" by the very service account who has the file open.
     
    Could I have two file handles ?   Or, why is the service account, whom has the file open, cannot write to same file ?  (File locked)
     
    Cheers!
  • Michael E. Gernaey Profile Picture
    42,786 Super User 2025 Season 1 on at
    Possiblity of two handles to the same file ?
     
    The file really should never be locked more than 10 minutes, but you didnt share your flow so thats as much as I can tell you.
     
    The service account should play no part, whomever opens it doesn't determine how long its open.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >