cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AndreiCiurea
Level: Powered On

Flow doesn't read created/updated Excel file in SharePoint Library

I have a SharePoint library to which Excel files will be saved periodically. I need a flow to access each file when it's added to the library and take some action with the data within. The specific action isn't relevant since my issue is that I can't get Flow access the file dynamically.

I'm trying to get Excel Online (Business) actions to work with the trigger "When a file is created or modified in a folder". My test file is called "text.xlsx" and it has a table element in it. If I select the file 'statically', with the file browser ...

 

1.png

 

... it works, as below.

 

2.png

 

However, if I create the same syntax in the "File" field, by typing "/[File name]" ...

 

3.png

 

... it fails, as below. Even though the input for "File" clearly looks identical ("/text.xlsx"), the error says it's an invalid value.

 

4.png

 

I've even tried it with just the dynamic content, without the '/', but I get a different error ...

 

6.png

 

... and I get the same error if I use the "File identified" dynamic content (a proposed solution mentioned in a separate thread on this forum).

 

5.png

 

Could anyone point out what I'm doing wrong and also what a solution might be?

 

Also, on a separate but related note, could someone please confirm whether an excel file *needs* at least one table element in it in order to function correctly with the Excel actions? As in, if I just have a file with data in it, but not formatted as a table, there's no way to get flow to read the data?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Flow doesn't read created/updated Excel file in SharePoint Library

Hi @AndreiCiurea,

 

Thanks for feedback.

I am afraid that choosing a dynamic content in the File field has not been supported by connector Excel (Business). Currently, we could only select a file by clicking the Show picker.

There is a similar request on Flow Ideas Forum, please vote the idea at here:

https://powerusers.microsoft.com/t5/Flow-Ideas/Dynamic-content-in-File-amp-Table-inputs-Excel-Busine...

About your second question, if you haven’t formatted the file as a table, then you won’t be able to get the data from the table.

 

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.

View solution in original post

11 REPLIES 11
Community Support Team
Community Support Team

Re: Flow doesn't read created/updated Excel file in SharePoint Library

Hi @AndreiCiurea,

 

Thanks for feedback.

I am afraid that choosing a dynamic content in the File field has not been supported by connector Excel (Business). Currently, we could only select a file by clicking the Show picker.

There is a similar request on Flow Ideas Forum, please vote the idea at here:

https://powerusers.microsoft.com/t5/Flow-Ideas/Dynamic-content-in-File-amp-Table-inputs-Excel-Busine...

About your second question, if you haven’t formatted the file as a table, then you won’t be able to get the data from the table.

 

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.

View solution in original post

AndreiCiurea
Level: Powered On

Re: Flow doesn't read created/updated Excel file in SharePoint Library

Thanks for the quick reply Mabel, and for the link!

Community Support Team
Community Support Team

Re: Flow doesn't read created/updated Excel file in SharePoint Library

Hi @AndreiCiurea,

 

Thanks for your understanding.

If this answered your question, please accept it as solution.

 

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.
panand99
Level 10

Re: Flow doesn't read created/updated Excel file in SharePoint Library

@v-yamao-msft @AndreiCiurea 

 

Are you able to find out the solution of this issue?  

amitK
Level: Powered On

Re: Flow doesn't read created/updated Excel file in SharePoint Library

@AndreiCiurea @panand99 @v-yamao-msft @Phamtungx  @dogBotherer @LoviseH @comiles @Wheatcroft @kaishavtrehan88 @memysha @Robertas @zdliang @DarrenK @RTW 

 

Got Solution to read dynamic Excel files from Excel connectors: (added in sharepoint or onedrive etc)

100% working

 

1) "Create file" connector is saving Excel file received from outlook into onedrive folder.

2) I have used "ID" field from "Create File" connector so when I hover over ID then it shows "body('Create_file')?['Id']"

that's why I have added it in below formula / function.

(below formula will work for you as setting file dynamically. (Please see now 2nd screen shot)

 

replace(substring(body('Create_file')?['Id'],int(lastIndexOf(body('Create_file')?['Id'],'.')),sub(length(body('Create_file')?['Id']),int(lastIndexOf(body('Create_file')?['Id'],'.')))),'.','')

 

id.png

 

Add above updated formula in Set variable's value field by Expression

and then use in Excel connector's file field as shown below.

DynamicFileIssueSolved.png

also note that your dynamic Excel files can be macro enabled .xlsm too but if those Excel files has button then your flow will fail while reading excel by Microsoft flow (It fails at my side). for this issue you can insert button image and have macro run on image click events.

 

Best Regards,

Amit Kshirsagar

 

 
RobertoE
Level: Powered On

Re: Flow doesn't read created/updated Excel file in SharePoint Library

That's excellent, thanks for sharing! Nonetheless, I fear this is not applicable when adding rows in the table is required, as the designer is unable to infer the columns to be populated (and does not allow them to be declared either...).

amitK
Level: Powered On

Re: Flow doesn't read created/updated Excel file in SharePoint Library

@RobertoE 

 

for each table rows flow sets unique id and also by logically we can add new records or update existing records in Excel table.

You can share scenarios to test 🙂

RobertoE
Level: Powered On

Re: Flow doesn't read created/updated Excel file in SharePoint Library

Hi Amit,

Thanks for your interest and willingness to help.

My case can be roughly summarized as follows:

  • I need to create multiple copies of an xlsx template to multiple SP locations.
  • Given specific business logics in the flow, different data should be injected on a case by case basis in a table located in a hidden worksheet of the file, which we use as a sort of configuration panel to alter the way several formulas behave throughout the file.
  • Now, given the apparent impossibility to perform the “insert row in a table” action on excel files solely referred by a variable, I was forced to establish a loop where I:
    1. Inject these meta information in the original template.
    2. Copy the file to the intended location.
    3. Clean the original file and cycle over the loop.
  • This works pretty fine. However, the necessity to operate directly on the original template prevents me from using the parallelism feature MS Flow offers for “Apply to each” loops. Given the fact that I need to rapidly generate these templates in batches of 300, I really would need to perform the data injection step on the new files, thus allowing parallelism.

 

Please let me know if there’s anything in the abovementioned scenario requiring clarifications.

 

Regards,

Roberto

ramgkulkarni_rb
Level: Powered On

Re: Flow doesn't read created/updated Excel file in SharePoint Library

Hi Amit,

Pls can you help me with a similar issue. 

I cant seem to find the table name using your method. 

 

My flow:

Click button in powerapps -> initilialize variable -> List rows from excel -> insert row(SQL)

 

 
amitK
Level: Powered On

Re: Flow doesn't read created/updated Excel file in SharePoint Library

@ramgkulkarni_rb 

 

I am assuming that all dynamic Excels has same table name.

In this case, please select file as usual.

Table name will display in "table" fields dropdown list.

Copy the table name.

add dynamic file name as mentioned in below screen shot

and past table name. that's it.

Table.png

ramgkulkarni_rb
Level: Powered On

Re: Flow doesn't read created/updated Excel file in SharePoint Library

Thank you Amit, youre a genius. 

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 (Last 30 Days)
Users online (6,331)