How to perform a vlookup in 2 datatable

datatable

#1

FINAL
I have two data tables 1 and 2 based on column A i have to perfom a vlookup and fill column C in data table1 with column B values of data table 2


#2

Use assign activity
dt1.rows(0)(3)=dt.Select(“a=’”+dt1.Rows(0)(0).ToString+"’")(0)(1).ToString


#3

Can you share a sample xaml


#4

is any solution for Vlookup on 2 datatables?

i am searching for the same but not found any solution.

if any one knows please provide me

my data table contains minmum of 1000 rows and 55 columns


#5

use for each for datatable 2
dt (contains text to find)
for each row in datatable (contains column text to find and column result text)
row.item(3)=dt.Select(“a=’”+Row.item(0).ToString+"’")(0)(1).ToString
next row


#6

Hi Atrimal,

My excel contains atleast 500 rows and 500 rows.
if i apply above logic it will be 500* 500
and also i have to vlookup on e excel files
hence my robot is crashing.


#7

upgrade you hardware config. or wait till the process completes as this much rows will take time.
You can have log message for each row in loop to check how many rows completed or which row is in progress


#8

during execution of process itself Robot is crashing and i am getting popup robot crashed.
Hence i am looking for alternative solution.


#9

i found solution in Linq like below

var q = from dataRows1 in dt.AsEnumerable()
join dataRows2 in dt1.AsEnumerable()
on dataRows1[“ID”] equals dataRows2[“ID”] into lj
from r in lj.DefaultIfEmpty()
select dtResult.LoadDataRow(new object[]
{
dataRows1[“ID”],
dataRows1[“Name”],
dataRows1[“Age”],
r == null ? 0 : r[“Salary”]
}, false);

when i changed above code as per my requirement i am getting error can any one help on this.