I have a problem in performing a comparison between two tables, which must end with a single notification.
After a series of scrapings, I collect two such tables, let’s say.
My goal is to make a comparison between the two, which must give only one notification of OK if they are identical, and of KO if they are different.
at this time I used a code of this type.
The problem is that the control being on all lines, it returns me for the first line, the notification of KO, and on the second of OK.
I need a check on the table, “absolute”.
That is, only if all lines are the same, OK
if not, KO.
In this case, KO.
Can help me with this?
I’ve tried this, outside the “For Each” loop, but the notification always KOs, even if the two tables are the same.
I do not understand.
This can be tried using the Linq
DTSame = DT1.AsEnumerable().Except(DT2.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable
If DTSame.Rows.count>0 then “KO”
Refer this link
@trunghai you can do this in way
Read the first excel file and store in dt1
Read the second excel file and store in dt2]
To find uncommon rows between the dt1 and dt2 use the following way
dt3 = dt1.AsEnumerable().Except(dt2.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable
Then use an if condition to check the dt3 has rows or not , if dt3 has rows then the two datatable are different if not two datatables are same
Refer this workflow
sample_12.zip (2.6 MB)
Hope it h…
Use this expression in a IF condition which will give you a notification on comparing two datatables
If the above condition is true it will go to then part where use a assign activity with value as “OK” or goes to else part with value as “KO”
Thakns at all…
and… Not Work well… Unfortunately.
I also need to consider the contents of the cells.
I did some tests but without success.
I found an alternative route by doing so, perhaps.
I don’t have much experience, can you tell me whether to see problems that I don’t see?
It seems to work, but being a bot in production I would not take the risk.
then in if
first condition is fine
what is the value of variable l in row(l) in second IF condition
Kindly clarify that
I added an Index
in the properties of the for each loop.
BOT1-Coupa_Snow.xaml (1,0 MB)
Check below for your reference
sorry i can not use this solution…
As I want to Read Next row value before i continue to regiser the current row…
my issue is
When i have done reading current row through if statement … then I want to know… the next row Category before continue…
And if there is no category or no row in table which has Category … then it should continue and register the current row in systerm…
But it giving me error when it there is no row in system–
Hope this helps you
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.