Read Emp ids from one excel store in a variable – search this Emp id in 2nd excel

Can any one share the steps for achieving below scenario if already done.

Read Emp ids from one excel store in a variable – search this Emp id in 2nd excel if matched pick the corresponding Emp name and store in variable - which can be use as search string in web application.

@shilpapmk

  1. Read the specific column from 1st excel using read column activity( with range like A2 don’t use 1 index since at first position excel contains column names and store the output in list( for example list1)

  2. Read the second excel and store the output in datatable variable ( for example dt)

  3. use normal for each and provide list1 as input which the output of read column activity from 1 St excel.

    4) using assign activity get emo name for each 
        emp id.
    
         String variable = dt.Select("[empidcolumnname]='"+item.tostring+"')(0)(columnnumberofnamecolumn).fostering.

Thanks for the quick response - tried the same steps above getting error …

@shilpapmk try like below and let me know if any further problem

dt1.Select("[Employee ID]=’"+item.ToString+"’")(0)(1).ToString

Thanks again - compiler error is resolved now - but im getting below issue-

image

Sorry to bother u again …let me know if have solution to this issue.

@shilpapmk there might be space after ur column name try to give one space at end like below [INEMP3140 ]

Tried to give a space as below -but still getting error

dt1.Select("[Employee ID ]=’"+item.ToString+"’")(0)(1).ToString

image

@shilpapmk Try to give space before also once. If u still getting that problem, take new excel file and check options which i have mentioned.

@shilpapmk

Basically you want to match empid column from dt1 to empid2 in dt2?

If this is the case

Component for Two Datatable Column Match and Get The Matched Records.xaml (5.9 KB)

Above code can solve your problem easily within sec.

Regards,
Aditya

take new excel file and check options which i have mentioned ?

Can you tell me which option you are talking about, i need this solution badly so im following it up …

Thanks for your suggestions

yes correct i need to compare 2 columns emp id of dt1 with emp id of dt2 and if they match pick the corresponding emp name and do some other process…

@Manjuts90 - pls refer to the .xaml file and xlsx’s file which im using …could u pls suggest the correction.

ARCReadEmpnamefetch.xaml (10.5 KB)
changes1.xlsx (8.8 KB)
changes2.xls (7.2 KB)

@shilpapmk

change2 file is empty
can you please upload correct file?

changes2.xlsx (20.5 KB)

uploaded the correct file can u check now

Tq :slight_smile:

@shilpapmk
ARCReadEmpnamefetch.xaml (10.9 KB)

please check this

Getting this error

@shilpapmk
open assign stage and change cast from int32 to string

pls see below the declaration for storing out put - it is declared as datatable not as int32

@shilpapmk

Component for Two Datatable Column Match and Get The Matched Records.xaml (6.3 KB)
changes1.xlsx (8.8 KB)
changes2.xlsx (20.5 KB)
ARCReadEmpnamefetch.xaml (10.9 KB)

please check…! now it should work.

Yup! This is working thanks for back to back reply and solution provided :joy: