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 / Power Automate Desktop...
Power Automate
Answered

Power Automate Desktop - loaded CSV to Dataset, For each - CurrentItem - is there a Row Number property?

(0) ShareShare
ReportReport
Posted on by 91

I have loaded a CSV file using "Read from CSV file" and this produces the variable "CSVTable" which is a Datatable. Then I am going thru the items in the data table with a "For each" loop , which places each row from "CSVTable" in the variable "CurrentItem". 

 

Is there some internal variable (something like "CurrentRow") that can tell me the Data table row number property of "CurrentItem"? 

 

 

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

    Make sure you tell "Read from CSV file" if the first row is titles, so the first row [0] is actual data.  The syntax for getting a specific data sets is %CSVTable[Row][Column]%.  So, if you wanted the 3rd column from the first row, just remember that they both start with 0, so it would be %CSVDataTable[0,2]%.

     

    For something like, for each row, do XYZ, I would use a loop instead of For Each:

     

    Loop Starting at 0 ending at %CSVTable.RowsCount% increment by 1.

    Then you can say %CSVTable[LoopIndex][2]% to get the 3rd column of the row indicated by the LoopIndex.

     

    Good luck.

     

     

  • charles_ross_oh Profile Picture
    91 on at

    These are good tips, thanks. However those are not answers to the question I posted., which is for a current row property.

  • MichaelAnnis Profile Picture
    5,727 Moderator on at

    You asked for a way to get through each row with a variable that could be used for a row index.  I gave you an example of how to do a Loop where %LoopIndex% is the row variable.

  • Verified answer
    tkuehara Profile Picture
    667 on at

    Hi @charles_ross_oh 

     

    There's no "current row index" property when running a for each loop. You need to create a variable and increase it manually.

    tkuehara_0-1630420432348.png

    Or, alternatively, rewrite the code to run a simple loop and therefore you'll have the built-in index variable in it as suggested by @MichaelAnnis. Please notice though that the loop index might not match with your data source (in the example above, an Excel file) row, so you'll still need to adjust it according to your needs.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 298 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 150 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 147 Super User 2026 Season 2

Last 30 days Overall leaderboard