For each row to iterate only through a column

Hello guys, how can I use for each row to iterate only through a column? Thanks!

Use inside for each row
row(column name)
Give name of the column inside that table

Use For Each instead of for each row and in the values, pass the value as datatable.Columns which will loop through the columns of the data table if you want to loop through columns.

Else if you want the data table to be looped through only one column for all the rows, you can use it as row(“Column Name”).tostring which will return the value for each row from that one particular column

Hi
there are two ways
either with this expression
youdatatable = yourdatatable.AsEnumerable().Where(Function(a) a.Field(Of String)(“yourcolumnname”).Equals(“anyvalue”)).CopyToDatatable()
here i have used Equals method just forr example
we can use any condition we want, and this will iteraate only through that speciffic column mentioned

or

Typical method of using READ RANGE activity andd get the variable dt
–then use FOR EACH ROW activity and mention the datatable variable dt as input
–inside the loop use row(“yourcolumnname”)
so that it will look upon only the specified column

Cheers @Ionut_Frincu

1 Like

Hi all,
In order to iterate through a specific column, one can use For Each Row activity and this way you can access the specific column by row.Item(“columnName”)

1 Like

what if I dont wanna specify column name ? I just wanted to show every column and print it inside for each row ?

Have you tried this @RajivKumar12