String Data to DT

Hello Team,
I’m having Data,
eg:
MONOCYTES
EOSINOPHIL
BASOPHILS
IMMATURE GRANULOCYTE
NEUTROPHILS - ABSOLUTE
LYMPHOCYTES - ABSOLUTE COUNT,

I Want to write this to Datatable(Each row contains single value("MONOCYTES "),How can it be,done,Im confused
Please guide

2 Likes

@Mayyur Is the Data in a String Format?

Yes,It is string

@Mayyur Does the Datatable you want to write those values is Already Existing or are you creating a New Datatable for it?

Im creating a new DT

Fine
Create a datatable with a single column using build datatable activity
—then if this string is stored in a variable named strinput
Then in a assign activity
arr_str = Strinput.Split(Environment.NewLine.ToArray())

Then use a FOR EACH activity and pass the above array variable as input
—inside the loop use ADD DATAROW ACTIVITY and in ArrayRow property mention as {item.ToString} And in datatable mention as dt

Now this dt will have those values in each row one by one

Cheers @Mayyur

1 Like

@Mayyur Is there only One Column in Datatable?

Hello,
This is working fine,but creating a extra blank row in between two strings

Then in the split method mention this as well
arr_str = Strinput.Split(Environment.NewLine.ToArray(),Stringsplitoptions.RemoveEmptyEntries)

Cheers @Mayyur

3 Likes

yes,a single column

Check this workflow,
Test.xaml (9.1 KB)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.