Data tables

this is actually a question on linq but im working with ui path so i thought its suits here,
i have a data table with two columns x of bolean and y of strings
i want to concat to a string separated by a , of all the values on column y where the cloumn x is true im trying to do this with Linq and with mydt.where(function(r) r(“x”).equals(“True”)) and now i dont know how to continue with the select funcion can someone help me please?

i cant edit the topic i dont know why but i meant to write mydt.asenumerable().where(function(r) r(“x”).equals(“True”))

this should work fine for you
String.join(",",(from rw in mydt where rw("x").equals("True") select x = rw("y").ToString()).ToList)

Hi @adirb

Here is a video with LINQ to get data from DataTables. Maybe it could help you further: UiPath | Compare Two DataTables with LINQ | Function Intersect | Function Except | Function Union - YouTube

Best regards

i get an error while trying to run this command, why did you add the “x=”?
the error is just “cannot assign this paramter” and im trying to assign it to a string parameter


String.Join(","c, mydt.AsEnumerable.Where(function(row) row.Field(Of String)("x").Equals("True")).Select(function(row) row.Field(Of String)("y")).ToArray)


working perfectly fine for me.

if possible can you upload your xaml. It could be variable data type issue.

x in query is range variable more info Working with Range Variables and Let Statements in LINQ |