I am Having a data table where i am iterating through each row and check for some condition based on that i need to update the last column one by one

Hi Everyone,

I am having a data table, where i need to iterate through each row and check some condition if it is pass i need to put “yes” in Specific column and if it is fail i need to put “No” in a specific column for each and every row have to check the condition and based on that i have to update the column in as same datatable.

Example:
Name1 Name 2 AnsColumn
TT MM(Condition Pass) Yes(Need to done by bot)
KKH TI(Condition Pass) Yes(Need to done by bot)
MU TJI(Condion Fail means) No(Need to done by bot)
MMk VVV(Like tat i have to do for all the below scenarios)
JJJ KKKl

Have you tried datacolumn.expression?

@VinothComplee -

  1. Read Range - Output to Dt
  2. For Each thru Dt for each row…
  3. If row("Condition) = True
    Assign activity row(“Answer”) = Yes
    Else
    row(“Answer”) = No
  4. Outside of the loop Write Range the Dt to different sheet or same sheet as per your wish…
1 Like

Expression is very useful.

  1. new DataColumn variable : new_column
  2. assign DataColumn.Expression value
    new_column.Expression = “Name2 = ‘MM’ or Name2 = ‘TI’”
  3. add new DataColumn into DataTable : Invoke Method
    [Result]
    new column
    True ← Name2 : MM
    True ← Name2: TI
    False
2 Likes