How to update a row value in a datatable by checking another row value using LINQ

I have a datatable as Dt having 3000+ rows and 25+ columns
I need to check if a column named “Is Valid” have null value, then i have to update the same Column as “No”

Hi @muhamed.fasil ,

Have you tried the same operation using a For Each Loop, this looks like a Simple update which can be achievable using the For Each Loop, the execution time should be fast. Could you let us know what is the time taken for the Execution ?

We could go for Linq if it is really needed.

For Each row as Datarow in DT.Asenumerable
row(“Is Valid”)=If(String.IsNullorEmpty(row(“Is Valid”).Tostring.Trim),“No”,row(“Is Valid”).ToString)

Note : Use This Code in Invoke Code Activity.


Check as below

Check below workflow for your reference

ConditionalReplaceWithValue.xaml (11.1 KB)

Hope this may help you


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