Hi…
i have two datatable in the flow…
try to merge data based on column name…
i got this result…
My Flow…
Expected Output:
Thanks
Shyam
Hi…
i have two datatable in the flow…
try to merge data based on column name…
i got this result…
My Flow…
Expected Output:
Thanks
Shyam
i dont have any keywork to merge data…
Randomly value add value in define position.
didnt use any lookup or check the condition… Just add it.
Thanks
Shyam
Hey @Shyam_Pragash
Just try replacing second from
with ,
in the code.
Or try the below.
dt1.AsEnumerable.Select(Function(row, index) dtResult.Rows.Add(new object(){ row(0).ToString, row(1).ToString, dt2.Rows(index)(0).ToString })).CopyToDataTable
Thanks
#nK
your result comes from the nature of the cartesian product.
Your case looks similar to a side by side merge
we can do it by writing out excel2 with an offset or LINQ
(From x in Enumerable.Range(0, dt1.Rows.Count)
Let r1 = dt1.Rows(x)
Let r2 = dt2.Rows(x)
Let ra = new Object(){r1(0), r1(1), r2(0)}
Select row=dtResult.Rows.Add(ra)).CopyToDatable
Hi.
Thanks for you repy…
i tried above code… i got error “Assign: There is no row at position 3.”
Main.xaml (17.3 KB)
Thanks
Shyam
Hey @Shyam_Pragash
The row count should be the same for DT1 and DT2 as you mentioned. Else it will throw an error as you are getting now.
Thanks
#nK
Welcome @Shyam_Pragash
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.