Stef_99
(Mary)
March 20, 2024, 11:35am
1
Now I have use try catch.
but I have question about it.
Now I use block try use read data for each row and access data to web
and catch block I use screenshot and send mail
Question :
In block try I use read for each row and access data to web. If error in web I want to go to next row.
But I don’t know how to do?
Please guide me for solve it.
Thank you.
Yoichi
(Yoichi)
March 20, 2024, 11:42am
2
In general, it’s necessary to use TryCatch inside the loop as the following, for example.
Regards,
Lak_Ui
(Lakshmi)
March 20, 2024, 11:43am
3
Accessing data from web part alone you can add in another try catch inside the for each loop
Anil_G
(Anil Gorthi)
March 20, 2024, 11:43am
4
@Stef_99
Use try catch inside for each so that if any row fails it goes to next row
Cheers
1 Like
Add all the activities after for each in the try-catch block
In catch block handle the exceptions according to the requirement
Stef_99
(Mary)
March 20, 2024, 11:47am
6
@yoichi @Anil_G What set in catch block (for next row)
Yoichi
(Yoichi)
March 20, 2024, 11:50am
7
Hi,
If there is no activity after try-catch, it’s unnecessary to put any activities because it process end of the loop after try-catch and process next row. (However, it’s better to put LogAcrivity to display error occurs.)
If there is an activity after try-catch, use Continue activity.
Regards,
Anil_G
(Anil Gorthi)
March 20, 2024, 11:58am
8
@Stef_99
you can use only a log
but as its ui activity you can use reset activities if any to bring the ui state as needed
cheers
Yoichi
(Yoichi)
March 20, 2024, 12:06pm
10
Hi,
I think it seems necessary to use Try-Catch in Try-Catch. Or it may be better to extract inner logic to another workflow file then call it for readability and/or maintainability.
Regards,
Yoichi
(Yoichi)
March 20, 2024, 12:20pm
12
Stef_99:
Now if error I send mail error and end process.
But I think should go to next row if error -----> But if there’s still an error, I’ll send an email nd process.
For example, how about the following? If error occurs 4 times, exit the loop immediately and send an email in outer catch block
Regards,
1 Like
system
(system)
Closed
March 23, 2024, 12:21pm
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.