For each row in dt continue looping after throw?

Hello I’m trying to understand throw activity better here, throw is not really needed but just being added for learning purpose.

first read range (just one column of excel with numbers in it, datatable variable dt
then use a for each row in dt, if the number in that row is greater than 200, then throw (this for each is wrapped in a try catch, then in the catch block, I have a new businessruleexception for the throw.

when I ran it, the process ends after the first >200 instance is detected. my goal here is to just log that message but keep looping till the last row in dt. what did I do wrong or this is simply not something to use a throw?

thanks

Hi,

How about using Continue activity as the following?

Regards,

2 Likes

Hi, I believe you need to wrap your for each body in a try catch like Yoichi mentioned above. If you wrap your for each in side the Try catch then once the throw happen it will stop the loop.

1 Like

thank you so much to both of you! I’m now very clear how this works!!

1 Like

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