Combine 2 datatables

Hi Team,

I have 2 datatables and want 1 column of my datatable to be inserted into the another datatable’s column.
Output DT:
[Material,Plant,Storage Location,Material Type,Special Stock

Please help.

Hi @yash.choursia

Use Merge Datatable activity.

Hope it helps!!

Hi @yash.choursia ,

Could you let us know how are we updating the data in the Datatable ? Do we have an ID column that we can match and then update ?

Also, do assure that when providing the Sample data/Masking Confidential data, preserve all the conditions and restrictions so that we can also apply it for the Sample data.

No Columns to Match Arpan,Actually i just need to add a column of one datatable to another thats it. We can restrict our focus to adding the plant column of the 2nd datatable to 1st datatable.

No, it is not working


Read the datatable and then add a datacolumn give the column name of the column you want to get from the other excel
Read the datatable of 1 column and store in datatable,to get the the column in range property
Take For each row in datatable
Take assign
var1=CurrentRow(“Column Name”).ToString
Take another for each loop
Write cell activity.

I hope this will work, Please give a try to my procedure

1 Like


Merge datatable gonna work if the two datatables have same name in your case.

Hi @yash.choursia ,

If looking for a Direct Excel updation, we could also check with Read Range and Write Range with Handled Range property (As It is only one column and irrespective of row match)


Notice in the Write Range activity Range property, "B:B" is the column/range that is already known to you or we could find as well. So we only update it with a Datatable having 1 Column only to the One Range/Column in Excel (B).

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