the assign activity often works but not now for reasons I understand.
I have error : Assign: Value cannot be null. (Parameter 'source')
the assign expression is : dt_extractFromCsv.AsEnumerable().Where(Function(row) NOT dt_controlDuplicateEntry.AsEnumerable().Any(Function(x) x("Id").ToString=row("Id").ToString)).CopyToDatatable
Then what’s happening is the expression is returning 0 records which causes .CopyToDatatable to fault.
Use the Filter Data Table activity and then this won’t happen. If no results match, then the resulting datatable will contain 0 rows, it won’t generate an error.
Wait, are you trying to find rows from one datatable where the Id exists in another datatable? For that you would use Join Data Table, set it to left join, and set it to “Id” (left table) equals “Id” (right table).
basically when the where condition returns 0 rows you would see this issue
so as a fall back first use an if condition with .count>0 and on then side use copytoDataTable and on else side as there are no rows just use dt_extractromCSV.Clone()