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

Create a file and read the same file

Hi Folks,

I am creating a file in a document library after fetching it from list item attachment. File type is excel. I want to read the same excel file using power automate for further process. File template is same in all cases. 

Please suggest how can I do this .

5 REPLIES 5
rsaikrishna
Dual Super User
Dual Super User

@Meshare 

 

Excel actions does not accept dynamic path of the Excel files.

 

All the excel files should have .xlsx file extension and also the data should be in a table in the Excel file.

 

You can use below blog to read the excel file dynamically:

https://manueltgomes.com/microsoft/powerautomate/how-to-access-dynamic-path-excel/

 

Regards

Krishna Rachakonda

If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.
Yutao
Microsoft
Microsoft

Hi @Meshare ,

 

This seems to be working for me:

Yutao_0-1598913790668.png

 

I used the "Create file" action to create the workbook (whose content was retrieved from a SharePoint list attachment). Then I passed the "Id" property from the "Create file" action to the Excel Online (Business) action (in my example, reading all the worksheets out of the workbook).

 

Hope this helps!

 

Yutao

Hi @Yutao ,

I am able to get worksheets as per your solution now I want to read tables from worksheets and perform calculation on it's cells . Can you please guide me how can I achive this further.

Hi @Meshare ,

 

Glad that helped!

 

In order to interact with the data in the workbook, you'll need to use the appropriate actions from the Excel Online (Business) connector. For example you can use the "Get a row" action to read out the cells of a row out of a table then you can do calculation based on those cells in the succeeding actions.

 

Below is a simple example that reads one row from a table of my workbook and adds up the numbers from two of the cells.

 

Here is the sample table:

NameValue1Value2
Apple14
Banana25
Cherry36

 

Here is the sample flow that reads a table row from a newly created workbook and adds up the numbers from two cells, then sends the result (in my case, "Result = 5") through the mobile notification.

sample-flow.png

 

The expression used to calculate the result (in the mobile notification action) is:

add(int(outputs('Get_a_row')?['body/Value1']), int(outputs('Get_a_row')?['body/Value2']))

 

I would suggest you read a bit more on how to use the Excel Online (Business) connector in Power Automate. There're a bunch of good articles out there on the internet. For example:

https://piyushksingh.com/2020/07/06/power-automate-read-excel-file/

https://medium.com/@anoopt/different-ways-of-getting-excel-data-using-power-automate-e21292b1d02a

 

You can also search up in this forum to see many great suggestions/tips contributed by the community.

 

Hope this helps!

 

Yutao

Hi @rsaikrishna ,

I can understand that excel connection can not take dynamic path.

Can I update my excel (eg Book1.xslx) which is stored in a library with dynamic  content after getting excel attachment content from list item  and each time use the same excel for reading.  

Please suggest.

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Users online (3,297)