Hi,
I have a Data in excel file
Input file
Expected Out: (Using for for Each row Activity)
IT Solutions,MediCare,Waterfront,MediCare,Timepath Inc.,Aperture Inc.,Sugarwell,Aperture Inc.
i am going the join the datatable to string.
tried but i am getting error
Error:
Thank
Shyam
ppr
(Peter Preuss)
2
we can do within an assign activity
only Distincts:
strFlatten =
String.Join(",", YourDataTableVar.AsEnumerable.Select(Function (x) x("YourColNameOrIndex").toString.Trim).Distinct().toArray)
with distincts:
strFlatten =
String.Join(",", YourDataTableVar.AsEnumerable.Select(Function (x) x("YourColNameOrIndex").toString.Trim).toArray)
Gokul001
(Gokul Balaji)
3
Hi @Shyam_Pragash
How about this expression
String.Join(",", (From row in DtBuild.AsEnumerable() Select Convert.Tostring(row("Excel date"))).Distinct.ToList())
Regards
Gokul
Gokul001
(Gokul Balaji)
4
Hi @Shyam_Pragash
String.Join(",", (From row in DtBuild.AsEnumerable() Select Convert.Tostring(row("YourColNameOrIndex"))).Distinct.ToList)
Regards
Gokul
Hi @Shyam_Pragash
Check this expression for unique
String.join(",",dtagentiitemp.DefaultView.ToTable(true, "Your Column name").AsEnumerable().Select(Function (a) a(0).ToString).ToArray())
Check this expresion for all the data includeing duplicates
String.join(",",dtagentiitemp.DefaultView.ToTable(False, "Your Column name").AsEnumerable().Select(Function (a) a(0).ToString).ToArray())
Regards
Sudharsan
Hi @Gokul001 @ppr
In the For each Activity i have to check some condition on based the text and finally join all the text in the datatable write into single cell…
i said code is working previouly now it showing complier error.
this is my previous flow for your reference.
Thanks
Shyam
ppr
(Peter Preuss)
7
when in a for each the flatten string is to construct then we suggest following
Variable: myStringList | DataType: List(of String) Default Value: new List(Of String)
For each row in DataTable
- do you evaluation
- when to add - use the myStringList and the Add to Collection / Append To Collection / Assign: myStringList = myStringList.Append(myValue).toList
AFTER the for each
strFlatten = String.Join(“,”, myStringList)
We recommend to use Lists when dynamically elements are to add and not to use arrays
Hi @ppr
do u have any sample code.
Thanks
Shyam