Help with for each in excel

Hi, I need help please for the following scenario.I have an excel spreadsheet whose content needs to be entered on a website. On the website there are text fields that can run on errors. In order not to map each error individually, I want the bot to write an entry in a cell when the record causes an error on the website, then it should continue with the next row. The content from the excel table is read in via a for each loop, how can I tell the bot to go to the next row and restart the process from there?

Hi ,

Maintain another excel to track the errors followed by below steps ,

Find unique field and copy them to status tracker
for each unique value go to website enter the fields in the website ,
if bot failed in entering , update the data table with ,row.Item(“columnName”) = “Status”
write the datatable

Hi @NHoe !
When you use a foreach loop (or foreach row) it will stay inside the loop till the end. So if you want to make paths differents depending on the error on the website, you could use IF activity (if you have only two cases).

Would you mind sharing your workflow so we understand where could we add the conditions ?

Hi, sorry for my late reply. I want to work without if condition, because I would have to extend that for each error. As soon as an entry from the for each loop goes to error, it should continue with the next line.

@NHoe Oh alright I think I understand.
What you might need is then a Try Catch activity !
Drag and drop a try catch activity:

And that’s it :wink:
Let us know if it does not work as expected !

Hi Hiba, thanks for the example but it does not work. The bot hangs as soon as an error and does not go to the next row of the Data table.

Hi @NHoe !
Do you mind sending us the workflow ? (xaml file) I would like to see where did you put the try catch :grin:
Do you confirm that you have run the bot in run mode and not debug ?

1 Like

Seems like you had debug your process instead of Run

I will rebuild the xaml and make it available to you later.

Main.xaml (17.6 KB)
Here ist the xaml

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