For Each & Lookup Data Table help

Hi All,

So currently I need to extract a certain set of files and check the data in them.

Essentially, I have a file with ID, First Name, Last Name and amount. I want to validate this data against other sheets. Right now, I’ve got a ‘File Path’ which is the file path and then ‘Files’ variable, which is new DirectoryInfo(FilePaths).GetFiles().OrderByDescending(Function(f) f.LastWriteTime).First().ToString. I was looking for some assistance to find whether this would read every file in the file path, or what should be next?

I was thinking that it would require a For Each File in Files and then read the files? I need and output each to a DT.

So then I need to look up against 2 data sets, to return whether they’ve already left/maternity and output this to excel. I also want for each file to be able to have the total count of each files ID and the total amount, how best would you suggest for doing this?

Apologies, I’m a bit new to this whole thing, so any help would be super helpful. :slight_smile:

Hi @AB44 !
Welcome to UiPath Community :grinning_face_with_smiling_eyes:
Here is a suggestion for your case to sart with it: Get_files_and_confront.xaml (7.3 KB)

To help you more, we need to have a sample of 2 files :wink:
If you can’t send it here, send it in private !

Hi @Hiba_B,

Thanks. I’ve got all of that.

Basically I’ve assigned my activities etc. at the top that will be constant (probably should have a config file for that, but here goes).

Following that, I’m reading my lookup files (which will stay the same, so I wanted those out of the for each)

I then have a counter for the amount of files.

Then I have this:

Essentially I’m pretty close to where I need to be, I’ve assigned everything in the middle of those images, which you won’t need to see. But what I need is from the ‘Lookup…’ is to pull that into another data table.

Already, I have employee id, first name, last name, amount. I need to lookup and validate everything I’ve got in my ‘Lookup *…’ and then combine this info, if this makes sense? I feel like what I need to know is how to add columns from my lookup data to my upload data table (already got that data earlier in the process from the GetFiles assign activity)

Apologies if it isn’t making much sense