Compare 1 row with multiple columns to another Excel File

The workflow is about reading the first row with multiple columns from excel and needs to compare this to another excel file first row with different column quantities and different values of the column.

If they are not the same, It will print a simple message.
If they are the same, I will print a simple message.

By the way, I’m using only Modern Activities on UiPath.

These are some files that have similar columns but the workflow is the same I need to compare these columns from different files.
test1.xlsx (8.2 KB)
test.xlsx (8.4 KB)

I.-I was trying this way but It only prints every char of the data table.
any ideas, please?

image

I’ve been reading other examples but It’s about 2 columns where the author only compares 2 columns, Could someone help me, please?

Hi,

Can you share more specific sample such as input file and expected output etc?

Regards,

Ok, I did it. Thanks.

HI,

There seems no data in test1.xlsx. Is this one of input file? Can you also share expected output?

Regards,

Ohh, Basically, The objective is compare the columns quantity and values like “codigo incidente” , “mes”,“semana”, etc.

Bot has to compare that test1.xlsx and test.xlsx have the same column names and quantities.

I’m trying this one with a for each but I’m not getting good results.

Hi,

If i understand your requirement correctly, the following will work, for example.
This flow check whether each value of specific columns in the row of 2 datatable are same or not.

CurrentRow("codigo incidente").ToString=dt2.Rows(idx)("codigo incidente").ToString AndAlso CurrentRow("Mes").ToString=dt2.Rows(idx)("Mes").ToString AndAlso CurrentRow("Semana").ToString=dt2.Rows(idx)("Semana").ToString

if the above is not your intention, please share specific input and output.

Regards,

Hi Yoichi.
I’m trying to use that but when I’m inside the “For each row in DT”

I have to uncheck “Has Header” in the activity Read Range of the file if not the workflow doesn’t go there.

Did you do that as well?

Plus, When I’m inside the “For each row in DT”, If I print the value of CurrentRow(“Codigo Incidente”) doesn’t work but CurrentRow(“Column1”) works, and so on.

image

Instead of loop you can use flitter data table

1 Like

Hi,

Why do you uncheck HasHeader? Is there duplicated header name? If so, the following topic might help you.

Regards,

IF I check “HasHeader” It doesn’t go into the loop I’m seeing this with the “debugging”

Hi,

I guess there is no row except header. Can you share screenshot of the sheet?

Regards,

test.xlsx

test1.xlsx

Regards

Hello @pprin001

Please check the below video. You can do a comparison of 2 data table and extract the similar and dissimilar rows.

Thanks

Hi,

This seems no problem. Can you share the above xlsx files and your workflow as file, if possible?

Regards,

test.xlsx (8.4 KB)
test1.xlsx (8.3 KB)
test.zip (75.0 KB)

I think as I selected a single row, It takes that row as a column header when I checked “Has header” plus uipath shows me empty values because I don’t have a second row plus It doesn’t go to the loop.

I’m trying just to verify if the 2 excel files have the same column headers("Codigo Incidencia,Mes…etc) and column quantities.

test1.xlsx has 11 columns.
test.xslx has 13 columns.

Please, Let me know any information, thanks.