My Excel loop doesn't work

Hey All,

In UiPath tutorials there is an Excel you read from and copy into the app and then copy the Transaction number and Account number in the Excel and show a message. I want this process to read all the data from my Excel, I put them in a 'For each row ’ but it only reads the first row. Please help. Thank you.
Exce Data reading.xaml (29.6 KB)

Hi @Aida_Azar

Can you check if the excel row is empty or not.

change the excel file and run the process

Regards
Gokul

2 Likes

@Aida_Azar Can you send the excel file, please? Thank you!

1 Like

Hi @Aida_Azar

Have you set the read range cell value to empty!

Because by default it will have A1:A2

I guess that’s the reason it only printing the first row

Set the cell range to empty and try again!

Regards

2 Likes

Hi,

We need to use CurrentRow variable instead of Excel.Sheet.Cell, as the following.

img20220214-4

Regards,

4 Likes

Hi @Aida_Azar

Apology for the wrong reply ,Not seen your xaml before posting!

You can go with method as said by @Yoichi for iterating through rows for a column you need to iterate!

Regards

1 Like

Thank you for your help.
Here You are!
Demo Excel.xlsx (9.8 KB)

Hi Yoichi,

Thank you. It went through all the rows but it didn’t save the transaction number and account number in my Excel. Should I make any changes in highlighted parts as well?

Hi,

Can you try the following in each property of “Save to”?

CurrentRow("Transaction Number")

CurrentRow("Column1")

Edit: I modified the above expressions

Regards,

1 Like

Hi @Aida_Azar ,

We access the Column Values of Each Row using the CurrentRow variable that will be already defined by the For Each Excel Row.

To access the values present in each row we can make use of the Column Name present in the Excel, like the below :

CurrentRow("Cash In")

CurrentRow("On Us Check")

CurrentRow("Not On Us Check")

CurrentRow("Transaction Number")

and so on…

The Updated Workflow is provided below :
Exce Data reading.xaml (29.7 KB)

Also, Since the Save After Each Row is Enabled, the changes should be reflected in the Excel after the Operation Completes.

Let us know if it still doesn’t work as Expected.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.