For each row crash on one row only

Hello and thank you,

I am using a For Each row activity to read through a data table I have scraped from a website and I’m having an issue. The scraped data can have anywhere from one row to 1000 rows but usually only one to ten rows. When there is only one row of data the activity crashes on the second pass. I’ve seen in other places where in the property pane you can enter “True” in the field “Is Error” and it will continue on without crashing but that’s not an option in the For Each activity. How can I get past this For Each issue?

HI,

I think inside the for each loop, you can use Try catch activity to do exception handling and handle the situation having incorrect data.

Thanks

@JayakumarSanthanam
Thank you, I’ll try that tomorrow

Hi
Like will the number of records differ
Even though FOR EACH ROW will iterate only based on number of rows in it
I didn’t get that buddy

TRY CATCH within loop for the body part alone will work, but if the above is one made cleared we don’t need to use a Try catch activity

Cheers @mworth123

@Palaniyappan
Thank you, yes, the number of records in the scraped table changes each time. Ive seen as few as one and as many as 1000 rows but usually it will be one to ten rows.

I’ll work on the try catch today

@Palaniyappan

I have very little experience with Try Catch. I know to surround the For Each activity with the Try Catch. How do I Catch the error when there is only one row of data in the table?

Thank you again

1 Like

Fine
Instead of keeping the whole FOR RACH activity inside the TRY block
Keep the Body container of the FOR EACH loop alone inside the Try catch activity
That is the structure will be like this

For each
Try block
—Body part of for each
Catch block
—exception handling
Loop ends

Cheers @mworth123

@Palaniyappan
Thank you for the explanation. I’m sure I’ll use this going forward. In this instance I decided to use an If statement where if the text I needed was found, it activated an activity and that seems to be working well.

Thank you!

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