How to update current datatable row

This is the scenario:

  • I have For Each on DT1 (datatable)
  • IF condition happens INVOKE Method adds the current DT1 row to DT2
  • DT2 has an extra field in the structure

How do I update only that field in DT2 after the row has been added from DT1?

I tried Assign DT2.Rows(“OID”) = DT1(dt_key)(“AID”) but I get implicit conversion error.

Thanks,

Why don’t you try using the Add Data Row Activity ? :smile:

In assign , @Tex_Willer
DT2.Rows(RowNumber In Integer)(“ColumnName”) = DT1.Rows(RowNumber In Integer)(“ColumnName”) .

1 Like

@Tex_Willer Are you trying to Filter the first DT1 with some condition and want to Add the Filtered rows to the second DT2?

Yes. The INVOKE method works (at least no errors). Here is what I have inside the FOR EACH

The Rownumber for DT2 sequence is not the same than DT1. I cannot do it that way. It could be record 0(zero) for DT2. I need to update the current record/latest record inserted.

I think I have solved it with

DT2.Rows(DT2.Rows.Count-1)(“AID”)

2 Likes

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