cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tracyannkenney
New Member

Loop through each row in excel

Hi -I have a data table loaded from excel storing info I use to input in SAP. 

I need a loop to go through each row to get each cell to populate a UI element created.

What is the best way to do this?

***I was creating a list for each column and was planning to loop through, but I don't think that will work. I need it to look through each row.  There is no "Get Rows" action available in Power Automate Desktop

Thanks in advance!

 @loop @excel @rows 

8 REPLIES 8
Henrik_M
Super User
Super User

The For each loop creates a dynamic %CurrentItem% variable with named cells (if you turn on headers in the advanced option of your Read from Excel worksheet. This means that you can pull out the exact data that you need each round, by writing something like %CurrentItem['ID number']% in your Populate text field action.

tracyannkenney
New Member

I do not see that option

tracyannkenney_0-1618522233214.jpeg

 

Canjun
Frequent Visitor

Canjun_0-1618583620971.png

Canjun_1-1618583782957.png

 

Hi Henrik,

I think I'm having a similar issue with the for each loop. Even The data table has 0 inside, the if condition wouldn't pop up any message

I do not see that option. I do see "First line of range is column name".

I still need help with the steps. I want each cell in the row input in SAP, run the transaction, then loop back and do the next row. Each row has 6 inputs. I only understand how to loop 1 input. 

tracyannkenney_0-1618585911494.jpeg

 

 

Henrik_M
Super User
Super User

You have the right option selected.

 

Headers usually default to Column1, Column2, etc. when your start row is blank.

 

Start row should be the header row.

 

What does your Excel file look like?

tracyannkenney_0-1618590789114.png

 

Henrik_M
Super User
Super User

If you run the same Read action on that sheet, the column headers should show Posting Date From, Posting Date To, etc... which you can then use in the loop: %CurrentItem['Posting Date To']%

@trax , did this work? I am in a similar fix to loop through Excel data on a web form / SAP screen

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,164)