Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

How can I get LAST ROW of Excel file in PowerAutomate?

Like (0) ShareShare
ReportReport
Posted on 14 Sep 2023 06:40:37 by 4

I am importing data from Power Vİrtual Agents to Excel via Power Automate. I need to keep the data last row in Excel the varriable. Excel is dynamically updated. I want to get last row in Excel. I have an Excel file. It has 3 column in a table. I want to get the last row of which is the column I want. But unfortunately I couldnt it. I need help about that.  I want to take columns in the last row and compare them.  These data are date and time. 

 

My second question is that there is date and time data in the cell i will import from excel. Can I compare  the sizes of this data? 

  • mertyuksel Profile Picture
    4 on 14 Sep 2023 at 07:50:13
    Re: How can I get LAST ROW of Excel file in PowerAutomate?

    Thanks. but its not enough for me. Because I want to take a row in the which column i want. And i take an error (invalid expression) about this expression last(outputs('List_rows_present_in_a_table')?['body/value']). I dont understand that if I choose "List rows present in a table", how i take last row the column I want.  My table has 3 column.  Last row  is dynamically updated. I will use this value for next step. 

  • ManishSolanki Profile Picture
    15,085 Super User 2025 Season 1 on 14 Sep 2023 at 07:00:13
    Re: How can I get LAST ROW of Excel file in PowerAutomate?

    Hi @mertyuksel 

     

    To fetch the last row in excel sheet, pls check out the below sample.

     

    Input excel sheet used for the below example:

    ManishSolanki_3-1694674750374.png

     

    Use "List rows present in a table" action to get the rows from the excel sheet:

    ManishSolanki_0-1694674401497.png

     

    Next, add "Compose" action and using expression we will fetch the last row in the table. Expression needs to be written in the expression box as highlighted below:

    ManishSolanki_1-1694674548020.png

    Expression used for getting the last record:

    if(greater(length(outputs('List_rows_present_in_a_table')?['body/value']),0),last(outputs('List_rows_present_in_a_table')?['body/value']),null)

    If there are no record, then the expression will return null value.

     

    Output:

     

    ManishSolanki_2-1694674708231.png

     

    If this helps & solves your problem, please remember to give a 👍 and accept my solution as it will help others in the future.

     

    Thanks

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,776 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard
Loading started