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 / write thelast value in...
Power Automate
Answered

write thelast value in a list to excel

(0) ShareShare
ReportReport
Posted on by 124

I have a list and I want to always select the last item in it to paste into an excel spreadsheet.  I thought I could create a new variable containing the number of records in the list, then use this in the write to excel command - actually, in the example below, I want to get row 2, the last row with data in it.

How would I write the value in row 2 to excel using the 'write to excel worksheet' command

 

Craigja_0-1633453388493.png

 

  • Verified answer
    Henrik_M Profile Picture
    2,021 Super User 2024 Season 1 on at

    %TextList[2]% would refer to the relevant row in this case, but whether or not it's a smart solution depends on how sure you are of the row order.

    %TextList[TextList.Count-2]% would give you number 2 items from the bottom, regardless of there being four items on the list or 700.

    How structured is the data?

  • Craigja Profile Picture
    124 on at

    Not very is the answer to the structure! Its data from a webpage but thats pretty much the answer I was looking for the %TextList[TextList.Count-2]% bit

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 159

Last 30 days Overall leaderboard