How to add specific Columns from one data table to another

Hi @Sami_Rajput ,

For this Data, we do not have a Key Value that we could use to map the data between the two datatables.

In such a case, we would require an understanding of whether we need to join rows based on the position of the row and whether the number of rows remain the same in both the Datatable.

The method of joining using row positions could be done in the below way :

  1. Add a new Column Position in both the Datatables.
  2. Use a For each Row in Datatable Activity and update the value of Position Column in both the Datatables using an Assign Activity like below :
row("Position") = DT.Rows.IndexOf(row)
  1. After updation of Position Column in Both the Datatables, we could use Join Datatables Activity to join the rows based on the Position column.
  2. Now we have Joined Datatable which consists of columns present in both the Datatables.
  3. Using Filter Datatable Activity or DefaultView.ToTable() we could preseve only the required columns.

Let us know your thoughts on the method.

1 Like