For Each storing


How to store values that are iterate in the for each ?
for example i retrieved datatable1 columns in item using for each now i want to store that values so how can i store those values and after that how can i see those values in message box?

in DataTable1 there are two columns : number and character

pls also same for row…


Check this,

Rammohan B.


I get those values but can i store them in a variable?


You Can follow these steps:

  1. Read the excel using Read Range and store the value of excel in DataTable
  2. By using For Each Row loop the DataTable
  3. Give the box inside the loop and pass the value : row(0).tostring + row(1).tostring and you can store these values in two variable

By using assign activity
value1 = row(0).tostring
value2 = row(1).tostring

and you can give message box with value1 + value2


what if there are 100 of values?


Can you explain, what are you trying to achieve by storing them into variables?

Rammohan B.


Actually I am comparing two CSV files then i also want which particular column or row is not matched.I am currently on the following stage of project

new task.xaml (29.0 KB)


Check this,

Its not feasible to create one variable for each of the value, instead you can have 1 variable for each of the column which will store value of that particular instance of row. Above examples should guide you more on that.

Rammohan B.


Hello @ImPratham45
if you already have a datatable then use this
(From row In dtDataTable Select colx = row(0).ToString).ToList

above will give you list of all the items from column at index 0, change index as per your need.

let me know if it does not meet your requirement


Here actually they manually give the columns names. In my project columns are varying daily.


ok thank you i will tell yoy after implementation