Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Create a file and read the same file

(0) ShareShare
ReportReport
Posted on by

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 .

  • Meshare Profile Picture
    Meshare on at
    Re: Create a file and read the same file

    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.

  • Yutao Huang Profile Picture
    Yutao Huang on at
    Re: Create a file and read the same file

    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

  • Meshare Profile Picture
    Meshare on at
    Re: Create a file and read the same file

    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.

  • Yutao Huang Profile Picture
    Yutao Huang on at
    Re: Create a file and read the same file

    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

  • rsaikrishna Profile Picture
    rsaikrishna 3,703 on at
    Re: Create a file and read the same file

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,495

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,822

Leaderboard