Datatable Compare to Swap values

Hi, Can anyone please help me to solve this please!!
I have two DTs , Item1 and Item2, and i have to compare Item1 “SellCode”
image
by Item2 “SCode”,
image

If found then their price and Quantity will update by Item2 "Price"and “Quantity” values. and if no any extra value is present in Item1, then we to do nothing with that data,
Expected output:
image

Please Help.
Item1.xlsx (8.7 KB)
Item2.xlsx (9.7 KB)

Hi @Anjali_Rani

Please try join datatable activity,

image

Thanks

I don’t want common values, I have to swap the price and Quantity of Item2 in item if scode and Seller code will match.

Hi @Anjali_Rani

Please find the below xaml,

Main.xaml (11.2 KB)

Thanks

can you send me this xaml file again, this is showing Document is Invalid

Hi @Anjali_Rani

Please try below,

in if condition,

dt2.AsEnumerable.Any(function(d) d("SCode").ToString.Trim.Equals(CurrentRow("Sell Code").ToString))

In first assign activity,

CurrentRow("Price") = dt2.AsEnumerable.where(function(d) d("SCode").ToString.Trim.Equals(CurrentRow("Sell Code").ToString))(0)("Price").tostring

In second assign activity,

CurrentRow("Quantity") = dt2.AsEnumerable.where(function(d) d("SCode").ToString.Trim.Equals(CurrentRow("Sell Code").ToString))(0)("Quantity").tostring

Thanks

1 Like

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