A For Each Row question

Since this website has been changed I have no idea if this is where I’m supposed to post questions. This should be easier.

I have a For Each Row activity that reads through a data table pulled from a website. The issue I’m having is that I have a piece that takes from the table and then cuts of everything after the first five characters of the contents of that variable. This is within the For Each Row activity. This piece crashes when the For Each Row activity runs out of rows to read. How do I tell the For Each Row activity to stop when it has read all rows?

Thank you in advance

@mworth123

ForEach Row activity will process depends on how many number of transactions you have. May I know what error are you getting here ?

And also if possible could you please show me screenshot of ForEach Row activity properties.

@lakshman

Thank you and Im sorry it took so long to respond. I don’t always get time to work in UIPath

Here is the issue which perhaps I didn’t state correctly before. I am using a For Each Row activity to iterate through the rows of a table on a website. One of the things I am doing is pulling a piece of data using a variable (see screenshot below) called strReqType. Then I use Substring to remove all but the first five characters in the variable. This issue is that the For Each Row activity ** appears to be reading when there isn’t another row to read. This causes an error in the Assign image below because it can’t cut characters off of nothing. Can I use a Try Catch and a Break to stop the iteration cycle and move to the next number in the variable on the data table? Each number in the variable brings up a new table which gets reviewed by the For Each Row activity

I hope this helps. Please let me know if you have questions.
1

Hi
Use a IF condition like this inside the FOR EACH ROW activity
Not String.IsNullOrEmpty(strReqType.ToString)

If true means it will go to THEN part that is the the variable has some value in it and inside that Then part we can use your current assign activity with SubString method
Or if joy it goes to Else part where we can leave it empty so that it continues with the next item

Cheers @mworth123