Assign DataTable values by LINQ with condition

Hello,

I would like to create a reusable function that assigns values to a DataTable according to a condition (I am not sure if it is possible for the condition to be an input argument, In order to reuse the same workflow without the condition)

If it’s possible, inside the workflow should be an If statement (if condition present in input):

Then: Assign activity with LINQ expression embedding the condition (intDataRowIndex > 1)

Row.Item(intRowItemIndex) = row.Item(2).ToString+row.Item(3).ToString+row.Item(4).ToString

Else: Assign activity with LINQ expression without condition

Row.Item(intRowItemIndex) = “=”+row.Item(1).ToString

Input/Output:

  • dtData

Input:

  • isCondition
  • intRowItemIndex (for the left hand value in the assign activity)
  • for the right hand value in the assign activity, I’m tempted to set an array Of Type Object in input argument, like {“=”, 1, 2} (I would like some advices)

The script is like this

this part needs to be cleared and defined very strict in detail

But keep in mind:

  • compilation cannot be bypassed

Thanks for your PM

also have a look at the LINQ Operators Take/Skip

Thanks for the documentation.