ROW IS NOT DECLARED in ForEach Loop

Hi,

I do RPA Developer Fundation tutorial and at Lesson 6 (Build Your First Automation Process) in part 1 in video choose at Filter Activities → Show Modern (I don`t have, only Show Clasic), and in minut 11 of the video need to split firstName from lastName and Studio say me in ForEach Loop “row is not declared”. I do something wrong or it is an issue in library?
See pic attached below.

Hi,

Use CurrentRow instead of row since we given the item value as CurrentRow in the for each loop initiation. Please try and let us know. Thanks.

CurrentRow(“Name”).tostring.split(" "c)(0)

2 Likes

Hi

Welcome to uipath forum

You are almost done

If you can see there in the FOR EACH ACTIVITY you have a variable named CurrentRow

CurrentRow is of variable type Datarow
Which means this for each row activity will go through each row in that datatable in_dt_useData

As you have mention as row(“Name”).ToString it throws error
Change it as CurrentRow(“Name”).ToString.Split(“ “c)(0)

You expression denotes for each iteration like
Search for value in current row under the column Name and split based on space as delimiter and get the first value

Hope this clarifies

Cheers @Vicentiu_Stefan

1 Like

I understood my mistake.
Thank you very much. Error disappears.

1 Like

Glad it got resolved
@Vicentiu_Stefan

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