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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How can I retrieve the...
Power Automate
Answered

How can I retrieve the last value in a datatable

(0) ShareShare
ReportReport
Posted on by 46

Hi all,

 

Recently, I have retrieve a web site HTML data table and store in a variable data table using (extract data from webpage feature). The task is require to get the last row of each data table (the row of each HTML table is differ in every query). Any expert know which function can I get the last row of value in datatable. For example in this case the last row is Product 6, but for the next record may be differ number.  

 

datatable.png 

I have the same question (0)
  • Verified answer
    MichaelAnnis Profile Picture
    5,727 Moderator on at

    This site lists all variable datatype properties:  https://docs.microsoft.com/en-us/power-automate/desktop-flows/datatype-properties#datatables

     

    You can reference a datarow from a datatable using %DataTable[#]% where %DataTable[0]% is the first datarow.

     

    We can get the number of rows using %DataTable.RowsCount%.

     

    Since, the first datarow starts at 0, this is actually what we need to do:

     

    After getting the datatable to %DataTable%,

    Set Variable %LastDatarow% to %DataTable.RowsCount - 1%.

    Now, you can reference %DataTable[LastDatarow]% to get the last data row.

  • henryhvb5 Profile Picture
    46 on at

    Hi Michael,

     

    Thank you very much, you are my automate expert.

     

    I can retrieve the last row from data table

     

    Henry 

     

     

  • henryhvb5 Profile Picture
    46 on at

    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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 376

#2
Valantis Profile Picture

Valantis 361

#3
David_MA Profile Picture

David_MA 294 Super User 2026 Season 1

Last 30 days Overall leaderboard