Comapre two tables, write data next to unmatched rows

Hi, here is an example of rwo tables that I need to comapre. If dt1 has unmatched rows with dt2 OR dt2 does not contain value from dt1, column C then I need to write an error next to that row in dt1.

image

Hi

Hope these steps would help you resolve this

—get the datatable dr1 and dt2 of these two tables using read range activity

—then use a ADD DATACOLUMN activity and add a column to dt1 with the name you want

—then use a FOR EACH ROW activity and pass dt1 as input

—Inside the loop use a IF condition like this

row(“c”).ToString.Contains(dt2.Rows(dt.Rows.IndexOf(row))(“a”).ToString)

If condition is true which means it’s same it will go to THEN part or it will go to ELSE part where use a assign activity like this

row(“nee columnName”) = “ERROR”

—after this for each row loop dt1 will have the error column updated
—use write range activity and pass dt1 as input

Cheers @markosc

the String cannot be converted to System.Data.DataRow

Can I see at which activity this error in coming
May be a screenshot
@markosc

in IF activity

Is this what mentioned

And pls ensure you have the same column name as a and c

Can I see the screenshot if possible

@markosc

example.xlsx (12.0 KB)

Here is an example excel so if you could please give me an example xaml file.
It should write “ERROR” in dt1 in column “error”
Thank you

here you go with an xaml
err.zip (11.7 KB)

Cheers @markosc

It works but how do I do it to write “error” already in sheet 1

If it has the error column already then we don’t need this steps

Other remains same

Cheers @markosc

Do we have any further queries to discuss on this topic

@markosc

example.xlsx (12.0 KB)

Here is excel. I need to write error for each row, and dont want to write the whole datatable

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