cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ShadowKnight
Level: Power Up

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'.
image.pngFlowimage.pngError Message
Could anyone help me on this
15 REPLIES 15
GowthamR
Level: Powered On

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

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

ShadowKnight
Level: Power Up

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

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

 

GowthamR
Level: Powered On

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

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

Dual Super User
Dual Super User

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

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!

ShadowKnight
Level: Power Up

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

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

GowthamR
Level: Powered On

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

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.

Dual Super User
Dual Super User

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

@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!

ShadowKnight
Level: Power Up

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

@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.

 

 

Dual Super User
Dual Super User

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

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!

GowthamR
Level: Powered On

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

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.

Dual Super User
Dual Super User

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

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!

GowthamR
Level: Powered On

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

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

Dual Super User
Dual Super User

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

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!

Highlighted
Community Support Team
Community Support Team

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

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
Level 8

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

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

 

 

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 475 members 6,844 guests
Please welcome our newest community members: