Add list to specific column of datatable


#1

Hi

I want to add some list of string to specific column in a datatable using column name. Is anyone knows help me to solve this

Ex: list1= (a,b,c,d,e)
Datatable1= col1 col2 col3 col4
AA BB cc
Now I have to fill col4 with list values??


How to Add Column in the same Excel sheet?
#2

@Sunitha_Bist

1.Use For each Activity
2. Mention your list in foreach collection.
3.Inside For each use on Assign Activity
5.Create one integer variable and assign it to zero
4.use datatablename(count)(“column name”)=item
5.use one more assign activity and and increment the integer by 1

Note: Here i am using integer because if the list having duplicate elements list.index will not work because it will give first instance of that element

Regards,
Mahesh


#3

Hi @Sunitha_Bist,

"Column4"
using For loop activity
assign
Datatable(item.index)(“Column4”)=item

Regards,
Arivu