How to continue to next if condition within for each loop if any exception occurs

Hi Team,

I have a scenario where i need to read all files from folder and based on file name i need to upload the file in web application.

I designed in a way:
Read all files from folder
-for each file in folder
-If filename is “A” upload file in X screen.
-If filename is “B” upload file in Y screen.
-If filename is “C” upload file in Z screen.

I have to write a logic ,if file name “A” condition fails(Either missing some value or screen not loaded correctly) write the exception and should continue to read the next file in for each loop and upload the file name is “B”

Apprecaite your help here!

@RajeshT - add a try/catch block inside for each loop and add your business logic for a/b/c…
in catch block - system.exceptions - write the log with respective exception message add continue activity… if any exceptions occurred - it will go to the next iteration…


Thank you the response @GBK .

I have written the logic the Try/Catch block,and i got exeption what i written in Log Message.
Can we capture the log,where the flow has been disconnceted.


My flow have 10 activites,and flow failed at 6th activity.

Can i capture 6th activity name and exeption?

@RajeshT - pls try to log exception.Message and check - it will write the activity name…


This is perfect @GBK.

Thank you so much Man!!

1 Like

@RajeshT - Cheers!

1 Like

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