Error being thrown on Assign Activity

I am getting the below error for an assign activity. I am passing in ‘ShareclassTable2’ which is a data table.

ShareclassTable2.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(“”))).CopyToDataTable()

ERROR:
Assign: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled.

1 Like

Hi @elliot.barling

Please Retype the double quotes

ShareclassTable2.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable()

Regards

Ensure the usage of " instead of the inverted ones
But we can also rewrite to:

(From d In ShareclassTable2.AsEnumerable
Let chk = d.ItemArray.Any(Function (f) DBNull.Value.Equals(f) OrElse String.IsNullOrEmpty(f.toString.Trim))
Where Not chk
Select r = d).CopyToDataTable

EDIT-1: isDBNull usage

(From d In ShareclassTable2.AsEnumerable
Let chk = d.ItemArray.Any(Function (f) IsDBNull(f) OrElse String.IsNullOrEmpty(f.toString.Trim))
Where Not chk
Select r = d).CopyToDataTable

And handle empty results:

Hi,

Just retype the quotes in assign activity. Hopefully error will resolve.

Thanks

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