I want to add data in 2 different coloum of single row in DataTable

How can i add data in 2 different coloum of single row in DataTable.

I have below String Array split by between space.
col1 col2
“abc1” “xyz1”
“abc2” “xyz2”
“abc3” “xyz3”
“abc4” “xyz4”
“abc5” “xyz5”
“abc6” “xyz6”

how can add these two colums data in datatable

DataRowVar = DataTableVar.Rows.Add({“abc1”,“xyz1”})

or
use Add Data Row activity and give values in ArrayRow property like this {“abc1”,“xyz1”}
cheers
@pankajs3

@Pradeep_Shiv
I have used as you are saying but data are adding only in one coloum.
but i want two different coloum

1 Like

can i see your workflow??
@pankajs3

@pankajs3 Is the String array in this Format, {“col1 col2”,“abc1 xyz1”,“abc2 xyz2”} ?

@supermanPunch
No
Format is {‘col1’,‘col2’}
{‘abc1’,‘xyz1’}
{‘abc2’,‘xyz2’}

@pankajs3 So you have Many Arrays in that format ?

@supermanPunch
As i mentioned in my question that is real data i have

col1 col2
“abc1” “xyz1”
“abc2” “xyz2”
“abc3” “xyz3”
“abc4” “xyz4”
“abc5” “xyz5”
“abc6” “xyz6”

@pankajs3 Is it Possible to send a xaml File with the Data included in it, We Would have A Clear view of what operation to Perform :sweat_smile:

@supermanPunch
Sorry that is my whole project. So i can-not send that code. but input is string.

String s1 =“‘abc1’ ‘xyz1’”

i want to insert in these space separated columns in DataTable in Two columns and then write in excel.

Hi pankajs3,

First split the string based on space or anything and save them in 2 variables. then use add row activity to add. Put the above logic in a loop to add entire data. Hope this helps.

Regards,
Sunil Ch

@pankajs3 Check if this is what you wanted :
StringData_To_Datatable.zip (6.2 KB)