I have two datatables , and I have to join dt1 with dt2. dt1 has 3 column and dt2 has columns.
the resulting dt should be having 4 column. I am joining on the basis of primary key and I have assigned first column as primary key in both dt1 and dt2.
the line items in first column of dt1 and dt2 are unique and same
Still Invoke method not able to join both datatable.
dt1-
INR million
FY18
3/31/2018
Test40
0
0
inventories at the end of the year:1
0
0
finished goods2
300.1019267
222.105
work-in-progress4
231.2314402
180.679
stock-in-trade6
30.15119893
20.776
Test58
561.4845658
423.56
inventories at the beginning of the year:9
0
0
finished goods3
222.105
283.595
work-in-progress5
180.679
258.527
stock-in-trade7
20.776
16.25
Test610
423.56
558.372
net (increase) / decrease11
-137.9245658
134.812
dt2-
INR million
FY17
Test40
0
inventories at the end of the year:1
0
finished goods2
283.595
work-in-progress4
258.527
stock-in-trade6
16.25
Test58
558.372
inventories at the beginning of the year:9
0
finished goods3
354.123
work-in-progress5
243.616
stock-in-trade7
29.629
Test610
627.368
net (increase) / decrease11
68.996
.
I have assigned first column of both datatables as primary key
Join datatable will not give me the output i want , and per the definition of invoke method , It should give the result but its just giving me the error.
I’m confused as to why the join datatable won’t work? Based on the input you showed us and your expected output, a join activity would work perfectly & there are already screenshots from @Srini84 showing the results. Perhaps you can share the actual inputs since they must be different from your picture? Or you could share the results of the join datatable activity which will help show why it isn’t working.
As for the datatable.merge() method - it has some quirks and especially within UiPath i try to avoid using it. I had asked what paramaters you were using because there are optional arguments to the method and knowing which parameters you provided would help troubleshoot. I have found the most common reasoning for the constraint exception is due to case sensitivity or modifications made within code to the column names or properties
EDIT: here is example using your own inputs from your post and it matches your expected output exactly… delete.xaml (8.6 KB)
All special characters or just the slash? Try it with clean strings on a sample and see if it fails. If it fails then perhaps you have syntax error in your code.
Otherwise you could do a left join using Join DT activity and then remove the columns you do not need.