I have two data tables Dt1 and DT2
DT1
ID | Name | Section
1 | Sami | A
DT2
Grade | GPA
A+ | 3.4
The final output In DT3 should be like this
ID | Name | Section | Grade
1 | Sami | A | A+
I have two data tables Dt1 and DT2
DT1
ID | Name | Section
1 | Sami | A
DT2
Grade | GPA
A+ | 3.4
The final output In DT3 should be like this
ID | Name | Section | Grade
1 | Sami | A | A+
Apologies I just edited the question
please take a look
I want to merge specific Column from DT2 to DT1 not all the Columns
Hi @Sami_Rajput
Then You can First use Filter Datatable then you can Use Merge Datatable.
Regards
Loveleet Saini
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 :
Position
in both the Datatables.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)
Position
Column in Both the Datatables, we could use Join Datatables
Activity to join the rows based on the Position
column.Filter Datatable
Activity or DefaultView.ToTable()
we could preseve only the required columns.Let us know your thoughts on the method.
Hi @Sami_Rajput ,
if you want to get value from DT2 against DT1 column value then you need to user below workflow.
Sequence.xaml (12.2 KB)
Thanks,
Rajkumar
@tushar.c2
if I have many rows in DT2 then it will print only the last row every time
How can I handle that scenario
Remove the inner For Each Row and create an index variable for the outer For Each loop. Change the Assign to:
CurrentRow("Grade") = dt2(index)("Grade").Tostring
Note: This only works if both dt1 and dt2 has the same number of rows.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.