cancel
Showing results for 
Search instead for 
Did you mean: 

Is there an easy way to continue the next item in a for each loop in the event of an error?

PhilipMasters
Deputy Chef II
Deputy Chef II

So currently I have a for each loop iterating through a list of records in a Values array. The issue is if I have an array with 5 items and the third one fails (for instance a required field is missing) then the for each loop seems to stop and the final two items are not processed in the for each loop.

Is there an easy way to make it so that, if a record fails, the for each loop continues with the next record? I have tried using a Monitor branch however the only option I have is the DO NOT RETRY (that or retry multiple times) and this doesn't always seem to allow the for each loop to continue iterating.

1 ACCEPTED SOLUTION

Hi @PhilipMasters,
Cannot exactly say from the Image shared.

Trigger/Scheduler -> Monitor Block -> Repeat For -> Monitor Block1 -> Error Block1 End -> Repeat For End -> Error Block End.
Would look something like above flow.
Regards,
Prudvi

View solution in original post

5 REPLIES 5

shivakumara
Executive Chef III
Executive Chef III

Hi @PhilipMasters ,
I hope you are doing well.

To ensure the remaining items are processed even after a failure occurs in the middle of the iteration, we need to place the Monitor - Catch block after the For Each loop.

Hereโ€™s a reference for your reference:


Monitor_catch block.png

Please let me know if you need further help. @Prudvi  provided you the solution, I am adding image and note for your reference.

Thanks and Regards,
Shivakumara K A

Type a product name