web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Second to last row in ...
Power Automate
Unanswered

Second to last row in a table

(0) ShareShare
ReportReport
Posted on by

Hello Community!

 

I am needing a solution for getting the second to last row in a table using an expression. Filtering data in List rows present in a table does not work for my specific needs. I know that    last(body('List_rows_present_in_a_table')?['value'])   will get me the very last row in a table and it returns the data that I want. I need an expression that will get me the second to last row so that I can have all of the data from both rows in separate compose actions.

 

Thank you,
Noah

Categories:
I have the same question (0)
  • SanmeshG Profile Picture
    1,947 Moderator on at

    Hi @Noah100  ,

     

    I am assuming that you want the second row from the bottom of the table. This we can get by calculating the length of the array and skipping the first few rows.

     

     

    first(skip(outputs('List_rows_present_in_a_table')?['body/value'],sub(length(outputs('List_rows_present_in_a_table')?['body/value']),2)))

     

     

    Also an additional point the above expression will return an object , if you want an array then you can use the array function along with the above expression.  The expression if you want an array will be as below,

    array(first(skip(outputs('List_rows_present_in_a_table')?['body/value'],sub(length(outputs('List_rows_present_in_a_table')?['body/value']),2))))

    Hope this helps! 

     

    If this solves your problem , please give this answer a thumbs up and accept it as a solution.

     

    Thanks,

     

  • Chriddle Profile Picture
    8,513 Super User 2025 Season 2 on at

    Reverse the array, skip one item and then take the first one:

    first(skip(reverse(your_array), 1))

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 339 Super User 2025 Season 2

#1
trice602 Profile Picture

trice602 339 Super User 2025 Season 2

#3
David_MA Profile Picture

David_MA 270 Super User 2025 Season 2

Last 30 days Overall leaderboard