Datatable to string variable without header in uipath

@Ignacio_Insua_Feito I have datatable variable with single column like this

Column 1
ABC
ASD
AFC

i want to make it a string varible. so i used output datatable activity. but it contains this
Actual Output: column1ABCASDAFC.
Desired Output: ABC;ASD;AFC

Can you plz help. this is urgent. thanks

1 Like

You can loop through your elements and construct a string an item at a time. See the following.Main.xaml (8.6 KB)

Hi,

Try like this,

Two assign activity reuqired.
Declare one SList(of String) and one string variable
YourDataTable.Rows.Cast(Of DataRow).Select(Function(dr) dr(“Column1”).ToString).ToList()

string variable to get the value = String.Join(“,”, strListCodes)

@DanielMitchell it throughs an error in my workflow "Option Strict On disallows late binding

Can you share your workflow?

Check this xaml,

Main.xaml (6.5 KB)

@kapildarmoda,

From where you are reading this data ?

if it is reading from excel then use read range activity and will give output as dataTable. Here, uncheck header option in properties then it will give column values without header then you can convert it to string with outputDataTable activity.

@lakshman I have used assign activity and store all distinct values of a column in a datatable variable. now i want to convert it inot string variable without headers.

@kapildarmoda,

are you used read Range activity ?

@sarathi125 thanks a lot. it solved my problem.