Comparing Datatables

Hello! I have put some sets of data into two datatables, and I want to compare the data tables to see if they have the same values in them (the order of the rows doesn’t matter, and I only need to know if ALL the data is the same or not - I don’t need to know what is different)

DT1 has data from a spreadsheet
DT2 has data from the system

At present I am sorting both datatables by the first column (which is unique), and then using “Output Data Table” to output both data tables as a string, and then comparing the string using IF DT1str=DT2str

Is this the best way to do this, or is there a “better” way?

Thanks!

@andrewjames,

If you want you can compare DataTables also without converting it to string.

I guess your method also ok.

1 Like

Thanks, Can I do this just by doing:
If DT1=DT2 ?

@andrewjames,

Take two For Each row activities and pass DataTable to them and iterate it.

HI @andrewjames

These might be helpful for you…

I’ve tested out my solution, and it doesn’t seem to fail.
I suspect it is quicker than a for each loop when I don’t care about individual values - just the DT as a whole.

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