Hello, I need to store a list variable myList= [x,y,z] into a datatable column in the list format.
Inside the add data row activity I am passing myList to the corresponding column. However the result is:
System.Collections.Generic.List…
I was expecting to add my list with its values inside.
Is there any way to do this?
Thank you!
Srini84
(Srinivas)
2
@ycoledeandres
Welcome to forums
You can use For Each activity and then you can place add datarow activity
This way you can make List to Datatable
Thanks,
Srini
But I don’t want to iterate through my list, I want to add the entire list with its content in LIST FORMAT to the datatable columns.
Thanks though
Hi @ycoledeandres ,
Can you display your expected output in the data table after you insert [x,y,z] ?
Regards,
Jithesh_R
(Jithesh R)
5
@ycoledeandres ,
Can you please confirm how you want the output?

Or this?

Regards,
1 Like
Columns 1, column2, column3
-------, ---------, [x,y,z]
-------, ---------. [a,b,c]
So column3 will store lists.
second one but has to be in list format with its {}
@ycoledeandres ,
You can add the list to the data table but, however, you won’t be able to display it unless you access it by indexing the element.
And make sure that the column type is also list of strings

Regards,
1 Like
Jithesh_R
(Jithesh R)
9
@ycoledeandres ,
Check this workflow is this what you want?
ListToDataTable.zip (2.3 KB)
Output:

Regards,
And do you know how to iterate through the list while iterating through the data table.
So for each row in DT
For each item in currentRow(“column3”)
this is printing again the system.collections thing instead of the values inside the list.
Thank you!
vishal.kp
(vishal)
11
@ycoledeandres , You need to convert it to list :
CType(CurrentRow("Column3"),list(of string))

Regards,
That was great! Thank you! Was trying to do .toList bust was not working!
10/10
1 Like
system
(system)
Closed
14
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.