cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobinV86
Helper I
Helper I

Write to file on sharepoint: "Graph API is unable to acquire or refresh a lock on the file because it is already locked. Please close edit sessions and try again."

I want to dump a sharepoint list into an excel file every time it changes. I have set it up as in this post:

 

Get Items > For each (Value) > Add rows to a talble (Excel for business)

 

I've connected to sharepoint and selected the file and table. When I run the script I get:

 

Graph API is unable to acquire or refresh a lock on the file because it is already locked. Please close edit sessions and try again.

 

When I modify the flow, the table name will often disappear and I won't be able to select the table name again. 

 

What could be the issue here?

7 REPLIES 7
Willemijn
Resolver III
Resolver III

Hi Robin, 

 

I cannot open the link you provided, so cannot see what your Flow looks like. Could you provide some more information on your Flow actions? 

v-yamao-msft
Community Support
Community Support

Hi @RobinV86 ,

 

The link you provided could not be checked. Could you share it again?

 

According to your description, I have set up the flow likes below. However, the issue you mentioned didn’t occur.

 

The items could be saved from SharePoint list to the Excel table successfully, even the file is open. Besides, the table name won’t disappear.

1.PNG

 

Do you have any other flows that is also trying to insert data into the Excel table?

 

Please try to recreate the flow to see if the issue still exists on your side.

 

Which browser are you using? Please try with a different browser.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Mabel,

 

I have set it up just like this, but the file lives on our corporate sharepoint (cloud based). It is almost as if the flow is not able to get access (check out) the file on sharepoint. 

Hi @RobinV86 ,

 

Have you shared the Excel file with others?

 

Please make sure the file is not opened by other users.

 

Could you try with a difference Excel file to see if the error still exists?

 

Best regards,

Mabel          

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yamao-msft  Mabel

 

I am also getting the same error when, I load the excel file.  The tables within that file do not get populated.  I receive this exactly same error instead.

 

As per your suggestions, I have ensured that the file is not shared with any other users and it is not opened by any other application but excel on my laptop.

 

I have also tried to create another file with exactly same data but same error recurres.

 

Kindly help.

Anonymous
Not applicable

I wrote about this in my blog.   Make sure you are not editing the flow in one tab while you are running the flow in another.  There are a bunch of other reasons as well that are listed in the blog.

https://coyleonsharepoint.wordpress.com/2020/04/23/ms-flow-giving-graph-api-is-unable-to-acquire-or-...

OST-Hans
New Member

Hi,

If in some part of your flow updating the file causes the file to be locked, if your using Update File action is some of the actions that might locked your file and take some time to release the file.

 

BRegards,
Hans

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (84,931)