dtUpg.AsEnumerable().Where(function(row) dtMaster.AsEnumerable().Select(function(r) r.Field(Of String)("Column0".ToString)).Any(function(x) x = row.Field(Of String)("Column1".ToString))).ToArray

dtUpg.AsEnumerable().Where(function(row) dtMaster.AsEnumerable().Select(function(r) r.Field(Of String)(“Column0”.ToString)).Any(function(x) x = row.Field(Of String)(“Column1”.ToString))).ToArray

the above is giving error

Assign: Unable to cast object of type ‘System.Double’ to type ‘System.String’.

Please help to resolve

I hope you are trying to find the matching records between two datatable
The we can directly use JOIN DATATABLE ACTIVITY

And here the reason is like there is a small change to be done like this
dtUpg.AsEnumerable().Where(function(row) dtMaster.AsEnumerable().Select(function(R) R.Field(Of String)(“Column0”).ToString).Any(function(x) x = row.Field(Of String)(“Column1”).ToString)).ToArray

Cheers @glory1

Thanks Pazhani for the quick revert.

I tried this:
dtUpg.AsEnumerable().Where(function(row) dtMaster.AsEnumerable().Select(function(r) r.Field(Of String)(“Column0”).ToString).Any(function(x) x = row.Field(Of String)(“Column1”).ToString)).ToArray

but getting -
Assign: Object reference not set to an instance of an object.

can Join datatable be used for the datatables with different columns? not much idea in join datatable; also its huge data around 50K records.

I appreciate your help. Thanks!

1 Like

if it is big, the thing you dont what do do is those types of queries that will keep converting things left and right… if you are able to do those before bringing the data to uipath is better…

In General sich conversion exceptions are thrown in Case of field function is forced to a datatype Not Marching the column Data.

Not Set Reference exceptions comes from null values does mean one Datatable is Not initialized with Data

Your Statement is looking Like a Join Operation. So give a try on:
(From d1 in dtUpg.AsEnumerable()
Join d2 in dtMaster.AsEnumerable()
on d1(“Column1”).ToString) equals d2(“Column0”).ToString
Select d1).ToArray

Hi ppr,

I tried -

(From d1 in dtUpg.AsEnumerable() Join d2 in dtMaster.AsEnumerable() on d1(“Column1”).ToString equals d2(“Column0”).ToString).

not finding ‘To Array’ or ‘CopytoDatatable’ - Please help.

Kindly try once with JOIN DATATABLE activity
And for this

For copytodatatable or Asenumerable method
Kindly mention this assembly reference in xaml by opening that in notepad file

Cheers @glory1

uipath is here to help, try not using so many complicated expressions if you are not an experienced developer, try the activities that will do them for you… There is Join Data Table for this…

As mentioned adding the assembly is mandatory. Sometimes intelisense hangs, so Just write toarray or what want to implement. Close Expression Editor and Check If validation Error comes Up or Not.