How To Build DataTable and Compare with another DataTable

Hello,
at two different points in the flow, I collect two excel files from two different websites.

I have to compare a specific column, of the two files, and if the
number is contained in both files, perform operations on the website.

B.xlsx (9,4 KB) A.xlsx (18,2 KB)

The Value to be compared is the Purchase Order
with the PO Number.

If it is the same, I have to go back to the website and do some things.
When I’m done, go back to the excel file and continue x each line.

I saw the command
image
Of pack
image

but i have to convert the files to datatable.
Can anyone help me?
thanks…

Hi @AaronMark, to get your excel files into datatables simply use the excel application scope activity and insert read range activity inside “do”. The output of read range will be a datatable variable.
Then you can start using the comparison activity.
image
cheers,
Timo

1 Like

Hi, I just ran a nested a “for each row” activity and did a compare column data that I needed. . 150 rows each, about 2 seconds

uhm…
I can’t get the comparison between my two files to work,
or datatable.

On Site1 I collect table A.
On Site 2 I collect table B.

A.xlsx (9,5 KB)
B.xlsx (18,4 KB)

I have to do some operations on site 1,
only if the order number is present in both files.
So I thought of writing the list of common orders in a C.xlsx file.

In this case on site2, there are multiple lines,
since it is a test area.
(In production, the ratio should always be 1: 1.)

Check this link
https://www.youtube.com/watch?v=e4_qR4jT2xI&t=12s

Hi ashish_Verma…
I saw the video.
It looks exactly what I need.
I try … and update the post!

Hi Ashish,
I don’t understand how to add the row in the posthumous table.
The script, works partially, that is,
he can find the elements in common.
image ok.
Then,
I created new table to test.
image

When I have to set up the arrayrow, I get an error.
image

image

my string array: (row1.Item(“Purchase Order”).ToString,“Match”)

What could be the problem?

OK understood…
ouch!!
{ and no (
} and no )

WoW!! It’s Works perfectly!! Thanks!! :slight_smile:

Sorry, Verma,
another small snag that I can not run.

In my example, I compare the elements of column B (FILE 1) with column A (FILE 2),
and write in excel, the data in common between the two.

what I have to write in the file, it must be the data of both columns of FILE 1…

ex:
ColumnA - ColumnB
3029 - 041009347

If I am understood correctly what you are expecting, I hope below link will help you.

uhm… no, not really the concatenate… .
maybe. a Vlookup perhaps.

FILE 1 ---------------------------------------------------------------------- FILE 2

I have to look for whether the value of File 1 is present in File 2,
and if it is present, I need the relative value of Column A, of file 1. (Column Name: Service Timesheet).

To be precise:
Look for “Purchase Order” (file1) in “Approved Value PO Number” (file2)
for matches, I need to create a table that contains
the value of the “Service / Time Sheet” column, in the first column,
and the Purchase Order in the second.

Don’t concatenate… .
That data generates a list of IDs that I have to search for on a web page.

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