For Each storing


#1

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…


#2

Check this,

Thanks,
Rammohan B.


#3

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


#4

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


#5

what if there are 100 of values?


#6

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

Thanks,
Rammohan B.


#7

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)


#8

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.

Thanks,
Rammohan B.


#9

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


#10

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


#11

ok thank you i will tell yoy after implementation