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 / "When a file is create...
Power Automate
Answered

"When a file is created" Flow for SharePoint Online - Document Locked

(0) ShareShare
ReportReport
Posted on by 47

I have a Flow that triggers on 'When a file is created'. The goal of the Flow is to assign a property to the document. The file is created from the New menu in SPO.

 

The problem with this action is the file will be locked, of course, when the user creates the file. The file automatically opens in the browser (usually) thus is locked for editing.

 

Besides using a random retry interval on the trigger, is there any other solution available? I won't know when the document is unlocked as that would be an indeterminiate amount of time, based on user interaction with that document.

Categories:
I have the same question (0)
  • trevorseward Profile Picture
    47 on at
    Disregard, the Retry Interval will not work for this as the action will simply fail. Any other thoughts?
  • hariskadir Profile Picture
    4 on at
    Hi Trevor,

    When you said “When a file is created” do you mean uploading file or creating new microsoft office document?

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.
  • trevorseward Profile Picture
    47 on at
    Creating a new file. This action opens the file in the browser, which is the desired behavior.
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @trevorseward ,

     

    This is related to the file you created the new file. If you upload a file, this problem will not occur.

    Since Word online has an AutoSave mechanism, when you create a new file, even if you don't click Save button, the file will automatically save and trigger Flow.

    At the same time, in order to avoid content confusion when editing files, the file will be locked, so other actions in Flow may not be able to operate on it.

    You could try adding a Delay action in the Flow, waiting for the file to be edited and automatically unlocked to execute the remaining actions.

    Besides, please check this similar thread and see if it helps:

    https://powerusers.microsoft.com/t5/Flow-Ideas/SharePoint-Wait-for-file-to-be-unlocked/idi-p/180922

     

    Best Regards,

  • trevorseward Profile Picture
    47 on at
    A delay is unreliable. This requires you to know exactly how long you must delay for. This isn't something we'll know as a user can have the file open for an indeterminate amount of time. I need a solution to detect the error, handle it, then retry periodically until it succeeds.
  • Verified answer
    ScottShearer Profile Picture
    25,290 Most Valuable Professional on at

    @trevorseward 

    Please see my screen shot below and give it a try.  I create a loop and run until a boolean variable equals true.  I am using the run after configuration in the set variable actions to handle the error - this should allow the Flow to proceed until it is successful.

     

    Please note that I haven't tested this (short on time right now...) but I believe it will work for you.

    error1.jpgerror2.jpgerror3.jpg

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard