cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShadowKnight
New Member

Get tables - the parameter 'file' has an invalid value

Hi all,

I try to create flow with following condition:

Step 1: Copy file in Sharepoint: from file demo1 to demo2. 

File demo2 is created after triggering this condition.

Step 2: Initialize variable 

Step 3: Get the table from the new created file (demo2)

In step 3, I always get the error 

"status": 400,
"message": "The parameter 'file' has an invalid value '/demo2.xlsx'.
FlowFlowError MessageError Message
Could anyone help me on this
16 REPLIES 16
GowthamR
Helper I
Helper I

Hi @ShadowKnight ,

 

Using "Path" instead of variable might solve the issue. I mean store the path of the demo2.xlsx in the variable and use it in Get Tales.

 

Let me know if thet works.

 

Regards,

 

Gowtham

Hi @GowthamR 

Could you please explain a bit more on it since i'm just beginner on MS Flow 🙂

You mean to make the change in step 2.

How to store the  'path' of created file? Please help

 

Hi @ShadowKnight ,

 

On second though, you don't need a variable at all, You can select the file by clicking the Folder Icon in the file and you should see all the available Excel files.

 

FLOW Excel.png

Hi @ShadowKnight 

 

A known issue in the Excel connector is that you cannot variabalise the file name/ path and refer to it to extract any data. This is a limitation with the connector and you have to refer to the files by clicking on the folder icon and map the file and for the List Rows action : choose the table from the dropdown only. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi @yashag2255 & @GowthamR,

I understand that it's workable to select the specific file in step 3: Get table. However, in this scenario, this file (demo2) is not created until step 1 is triggered. That's why I'm unable to locate it in step 3.

So if there's any workaround or something wrong with this logic, please help to advise

Can you try and follow the logic as per the link and where the temp.text is replaced with '' you replace it with "demo2.xlsx" and then you can use that as the path get tables.

https://medium.com/@thomasgranheim/work-around-create-folder-in-sharepoint-library-using-microsoft-f... 

 

Let me know if this helps.

@ShadowKnight 

 

As i have mentioned in the previous post, the file cannot be selected dynamically in the Excel action as this is a limitation of the excel connector. At the moment, you can get to files that are already present on the library and not the ones that you are creating in the flow itself. The workaround suggested in the other reply might work for other files but definitely not for EXCEL.

 

Hope This Helps!

@yashag2255 

Could you share some documents about it: it's unable to select dynamically the Excel file due to excel connector's limitation, since it's quite limited resource here. Thank you.

 

 

HI @ShadowKnight 

 

You might want to look at this blog post below:"

http://johnliu.net/blog/2019/5/workarounds-needed-to-use-the-excel-connector-in-microsoft-flow

 

And this thread too:

https://powerusers.microsoft.com/t5/Connecting-To-Data/Can-t-set-dynamic-quot-file-quot-value-for-ex...

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

You are right, I tested it and it fails.

 

And in that process, it locked an excel file and now I cant delete it, any idea how I can delete it?

 

I had a test flow that ended after get tables from a excel online file.

 

I can't delete it now. 

 

Appreciate any help on this.

yashag2255
Dual Super User II
Dual Super User II

Hi @GowthamR @ShadowKnight 

 

So how it works is, on SP the file when you are accessing to run CRUD (create read update delete) operations, it checks out in lock mode so that the data is properly handled. Can you try the method shown here for deleting the file:

https://www.c-sharpcorner.com/article/resolving-file-checked-out-or-locked-for-editing-issue-in-shar...

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Hi @yashag2255 ,

 

Thanks for your reply.

 

The method in the link didn't work for me as I couldn't see the file in Manage files section.

 

However, I could delete it after leaving it overnight. 🙂

 

Regards,

 

Gowtham

yashag2255
Dual Super User II
Dual Super User II

HI @GowthamR 

 

Cool. Maybe the file was checked out for the flow runtime. 

 

@ShadowKnight 

 

Were these responses helpful in addressing your query?

 

If this question/query is ressolved, please mark as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

v-bacao-msft
Community Support
Community Support

Hi @ShadowKnight ,

 

Many thanks to the instructions provided by @yashag2255 and the method of dynamically populating the Table name using expression and dynamic content. This is great!

In addition, the Excel file is locked because the execution of an action in Flow checks out the file, so other actions cannot operate on the specified file in a short time.

We need to wait for the file to be automatically checked in before we can perform other further operations on the file.

If the file is stored in the SharePoint Library, you might consider using Check in file action to check in the specified file.

 

Best Regards,

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

Hello,

 

You can do that. You can get an excel file by having a text name.

 

Here is how:

 

Instead of your variable, get the list of files from the location you are copying the file to.

 

Then you go through the list of files and if the file name matches the file name you are looking for then grab the tables using the file identifier.

If you don't know your destination folder either you could loop through all your destinations to find the file you just copied.

That is if you don't have hundreds of sharepoints.

 

Here is my example:

1.PNG

 

In your case, comparing the file name might require using regular expression so you can strip out the file name from your uri.

I don't know what is available with the send HTTP sharepoint action.

 

So the example goes through all the files in the location then when the name contains the text name I use the current item's Identifier to open the excel file to get the tables.

 

Note that name content does not include extension. For more details you could look at the output "get files properties only" to find what to match.

There are different content items though that have the file name and even the extension, just depending on what you need.

 

My run

2.PNG

 

 

 

be_dvn
Frequent Visitor

Thank you @juresti  , that did the trick for me!!

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,097)