Help me skip the current iteration in for loop if exception found

syntax -

For each item in array
{

assign

write range

.
.
.
}
This is surtrounded by try catch

suppose if an exception comes then can I use break activity in the catch block to skip current iteration and move to next iteration of for each…

or the break activity will exit the for each loop which I don’t want

1 Like

@Gaurav07

Use Continue Activity to skip the current iteration.

https://docs.uipath.com/activities/docs/continue

2 Likes

Hi @Gaurav07,

1.You cant use continue in catch, it will throw error you can use it only inside for each…

continue

2.This will not help you to achieve your goal…

3.Try keeping the assign activity or the activity which you are expecting the exception and then keep continue in it…

4.so keep try catch inside for each…

Any doubts let me know…

Cheers.
Vashisht.

keep try catch inside for each loop and place continue in catch

1 Like

Break activity is used to exit from the loop.
Continue activity is used to skip the current iteration.

Regards,
Karthik Byggari

TryCatch inside For each? How?