How to move on to the next iteration of for loop when an exception occurs?

Hi guys,
Suppose inside a for loop I have 3 activities & the first activity is inside a try catch. If exception occurs then catch part will be triggered and exception will be handled. Now if this happens I want the bot to move to the next iteration without processing the remaining activities. But now it is moving to the next activity after handling the exception.
Can this be done?

@sayanghosh333
Have a Look on the Break activity, this will stop the loop

Now if this happens I want the bot to move to the next iteration without processing the remaining activities. But now it is moving to the next activity after handling the exception.

In case of you want to ommit the remaining 2 activities from the loop you can do following:

within the try catch block define a local variable and store the exception additional - localExcetionVar
wrap the others activities in an if else block with condition: isNothing(localExcetionVar)
true: execute remaining activities
false: do nothing
end or begin of the loop reset localExcetionVar with localExcetionVar = nothing

You can try putting everything in the try catch block.

1 Like

You can try within state machine…