How to catch exception but continue Loop Iteration ?

How to catch exception but continue Loop Iteration ?

  

Hi Team,

I am passing a list of records through REST web service and store it in an Out systems entity. This web service will get the records and iterates it in the Foreach loop which splits the values and insert it in multiple entities.  

I have a scenario wherein if any one of these record throws exception I should continue the loop.  

Example: I have 10 records in the list, the 5th record throws exception but still i need to continue the loop iteration with the rest.

Hi Mehraj,

You can wrap the action you are calling that might throw an exception in an action you create with the 'All Exceptions' exception handler attribute 'Abort Transaction' set to false.

Then where you are looping over this call, replace it with your new wrapped action, so if an exception is thrown, the loop will continue instead of breaking.

So the flow will be to loop over the action, if inside the action an exception is thrown, the exception handler will catch it and do whatever it is you want it to do, with the Abort Transaction set to false, so the loop will just continue moving forward and call the action again.

Let me know if this helps,

Justin

It works. Thanks for your swift reply.