cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

excel get rows fails repeatedly

 

I am trying to read an excel file that has been copied into the target folder when the same file in an another floder has been updated.

 

However, Excel Get Rows always fails. Any Ideas how to resolve?

 

{

  "status"400,

  "message""Failed to read metadata from file source. Response from the end service is : Bad Request\r\nclientRequestId: b80c18f8-4b14-44ce-9495-567b2a6abf33",

  "source""excelconnectionprovider-westus.tip0-westus.p.azurewebsites.net"

}

 

https://us.flow.microsoft.com/manage/environments/Default-3596192b-fdf5-4e2c-a6fa-acb706c963d8/flows...

 

Failing_Excel_Get_Rows_error_input.jpgthe input into "get rows"Failing_Excel_Get_Rows_error_output.jpgthe output of "get rows" with the errorFailing_Excel_Get_Rows_flow.jpgthe flow

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: excel get rows fails repeatedly

Thanks to hint of Mabel Mao / v-yamao-msft, I found a solution / work around for the issue. Use the FILE ID at runtime not the file name selection function at flow editing time.

 

The ORIGINAL flow went like this:

 

Trigger:             When a FILE is CREATED in input folder 

Action 1:           COPY it to working directory with a FIXED filename (changing the filename)

                         and overwriting the previous version in the working directory.

Action 2:           GET ROWS  using the FIXED file lookup when editing the flow. 

 

RESULT:           FAILURE, as the original file reference is not valid anymore. becasue I overwrite the file in the working directory, 

 

Solution / work around - get the File ID before the GET ROWS action:

Trigger:             When a FILE is CREATED in input folder 

Action 1:           COPY it to working directory with a FIXED filename (changing the filename)

                         and overwriting the previous version in the working directory.

Action 2:           Get files in working folder

Action 3:           For Each file in working folder,

                         compare filename = target file name

                         if Yes

                         Action 4:      GET ROWS using file ID rather than filename.

 

RESULT:           SUCCESS

 

A BIT CLUMSY and CUMBERSOME, yet working 

 

 

10 REPLIES 10
Community Support Team
Community Support Team

Re: excel get rows fails repeatedly

Hi ErichH,

 

In your flow, how do you get the File name and Table name in the action Get rows?


Are you using dynamic contents for these two fields?


Creating a simple flow on my side to test this issue, in the action “Get rows”, I select the File name and Table name from the dropdown list. I don’t get any error message when working with it.

3.PNG

 

Please check this documentation for a reference. From this doc we know that Flows also fail if a setting in an action of the flow doesn't function as expected. In this case, the error message contains Bad request or Not found, or an error code of 400 or 404 appears. Please check your flow definition and update it to see if it will work:
https://docs.microsoft.com/en-us/flow/fix-flow-failures


Best regards,
Mabel Mao

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.
Super User
Super User

Re: excel get rows fails repeatedly

Thanks to hint of Mabel Mao / v-yamao-msft, I found a solution / work around for the issue. Use the FILE ID at runtime not the file name selection function at flow editing time.

 

The ORIGINAL flow went like this:

 

Trigger:             When a FILE is CREATED in input folder 

Action 1:           COPY it to working directory with a FIXED filename (changing the filename)

                         and overwriting the previous version in the working directory.

Action 2:           GET ROWS  using the FIXED file lookup when editing the flow. 

 

RESULT:           FAILURE, as the original file reference is not valid anymore. becasue I overwrite the file in the working directory, 

 

Solution / work around - get the File ID before the GET ROWS action:

Trigger:             When a FILE is CREATED in input folder 

Action 1:           COPY it to working directory with a FIXED filename (changing the filename)

                         and overwriting the previous version in the working directory.

Action 2:           Get files in working folder

Action 3:           For Each file in working folder,

                         compare filename = target file name

                         if Yes

                         Action 4:      GET ROWS using file ID rather than filename.

 

RESULT:           SUCCESS

 

A BIT CLUMSY and CUMBERSOME, yet working 

 

 

phryll
Level: Power Up

Re: excel get rows fails repeatedly

unfortunately doesn't work for my purpose:

 

I need to get an excel file that has been modified dynamically. It is stored in different Document Libraries that further contains some document sets.

 

Seems like Flow can not get the excel file by a dynamically generated path. It's just possible by selecting the file with the file selector and the sharepoint library selector.

 

I hope this will be added as a feature in the future!

Or has anybody an Idea how to archieve this?

2.PNGThis is my setting..3.PNGThis is the output I get when trying with my setup1.PNGThis one is working.. (Library Selector & File Selector used! File determined NOT Dynamic..)

 

Super User
Super User

Re: excel get rows fails repeatedly

Hello Phryll,

 

I got to work reading a flexibly named file the following way:

first listing files in the directory, then selecting a specific file based on its name and using the file id.

 

> Get File metadata using path - with a variable directory name

> use the ID to List Files in Folder

> with a condition I run throught the files (body) and select the right file looking for the variable filename in Path

> I capture the File ID and use it to read the excel sheet

 

Hope this works for you

 

 

phryll
Level: Power Up

Re: excel get rows fails repeatedly

Can you attach a screenshot how you captured and used the ID for the excel action?

Super User
Super User

Re: excel get rows fails repeatedly

Read Folder and Files in it

VariableExcelFileNames_5-2-2018 4-48-44 PM.png

Super User
Super User

Re: excel get rows fails repeatedly

VariableExcelFileNames2_5-2-2018 4-50-44 PM.png

use the file ID stored in a variable

 

during Set up of Flow / changes, you have to use a "real" file identified by the selector - not the dynamic value

Super User
Super User

Re: excel get rows fails repeatedly

@phryll - does this help?

HieuVC
Level: Powered On

Re: excel get rows fails repeatedly

I can't use File ID when using Excel(Business) connector to access excel file in Sharepoint. Has anyone else have idea about this?

Pwhite
Level: Powered On

Re: excel get rows fails repeatedly

Erich, I want to be sure and let you know after researching the same problem for what seemed like a week looking for a solution yours worked perfectly for me!!! Sorry for the long post but I am immediate with understanding flow and wanted to explain in detail the steps that I wish people would be more detailed on that seem simple but are annoying when you get stuck.

 

2 Flows with the 2nd Flow "Get Rows" failing wtih "File Not Found" or "Can't read Metadata"

  1. In my scenario I had a separate flow copy an excel file each time overrwriting the old copy with the new copy with same name and tabele name. 
  2. In my 2nd Flow I did a Schedule to "Get Rows" from the copied file in Flow 1 above and it would throw the error "File cannot read metadata" or "File not Found".  Below are the steps from your advice that worked for me.

Steps (1- 8 with details on each piece of the Flow and a picture diagram laying out the entire flow)

 

  1. Started with a Recurrence schedule to Get Rows every hour.
  2. Action added to initialize a variable with exact path of the file that I simply pasted in and called the Variable FilePathVar.
  3. Then "Get Onedrive File Metadata", followed by "Get List of Onedrive Files in Folder".  For both of these I used the file selector to located the files for each of these steps.  Nice and simple.
  4. Then "Apply To Each" with the Value out selected from list of Dynamic Fields which was the output from "Get List of Files".
  5. Then added added a condition action to compare the "Path" (selected from list of Dynamic Fields) on the List of Values from the "Get List of Files" output and compare it to the "Variable" from #2 above where I set the value to the exact File Name I am looking for.  The Output for Path = Variable Name gives me the ID for the file I am looking for used in the next step.
  6. I then a
  7.  I then added action "Set Variable" to replace my earlier variable set to the "file path" that I typed in and now using the result from Path = Variable Name condition to get the ID for the file I want to Set the Variable to that ID value.
  8. After the Variable action was set to the ID found from the Dynamic Values I then added an action for "Get Rows" and used the new Set Variable as the file name.  I added it in from the list of Dynamic Values that populated.  Important:  I did get an error saying "can't find table values" so I simply manually typed in the Table Name and saved my flow and it worked!!  FlowGetRowsFullPic.GIF

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 54 members 4,778 guests
Please welcome our newest community members: