Repeat the loop with another file when one file error?

Hi all,

My workflow: loop for each file → check … if file error stops and send email (I use Terminate & Trow)

How can I make it when error file1 can skip and repeat the loop from file2?

Thank all

Hi @anh.nguyen

Encapsulate the process in Try catch and when the exception throws, in the catch block use Mial acitivty and after that give continue activity. It will skip to next iteration of the loop.

Regards

Hi @anh.nguyen

You surround with try cath and if any file get error it will flow to the catch and in catch you can perform the mail step and below mail you can use the continue activity soo
It will skip and flow to the next transaction…

Cheers…!

@anh.nguyen

Inside the loop use try catch activity so that if anything fails in the loop it still continues with next transaction

on failure if you need to send message then you can send email in catch block

if you need a consolidated message to be sent at end for all failures then in catch block we can add the error messages to a dtatable and then after the loop we can send one email with all details from the datatable

cheers

hi all,

Sorry my knowledge, can show me an image or workflow? thank you

This is my workflow

Hi @anh.nguyen ,
Have you tried "Try catch "
you can use catch exception
regards,

Hey @anh.nguyen ,
You can surround the Loop with Try Catch Activity
Like below screenshot
image

In the catch block you can add a system. Exception from the dropdown
image

And in System exception block you can add your Send SMTP message
Like below screenshot

Hope it helps you out!

Hi,
If error it will send an email and skip this file? and loop another file2?

Yes for that you have tosurround try catch to the activities inside the for loop

Can you show us the screenshot of activitiy which is erroring out
So that we can give detailed explanation

@anh.nguyen

Add the try catch inside the for loop around all activities in your for loop…

cheers

I use try catch but it stop, not skip and loop another file?

The error is in your SEMD OUTLOOK MAIL MESSAGE activity
Try wrapping that with TRY CATCH activity

I replace by Log mess but when see exception it not stop and not run another file2