How to select a column value in an excel by filter other column values

Hi Team,

I have an excel with column C1,C2,C3 and C4
I have 4 variables V1 ,V2,V3 & V4(Customised value which i will get from other xml file)

I need to check if C1= V1
C2=V2
C3= V3
If all these values are equal then corresponding C4 column value i need to take in my 4th variable V4.
Can someone please help me with this? I dont want to use for each in this case. what would be other other approach

Hi, what you can do here is
First read the excel file with excel application scope and read range and the output will.be Datatable variable ex:DT1
Create a Datarow array variable ex:DRarray1
Use an assign activity
DRarray1 = DT1.select(“C1=”+“'”+V1+“'” AND C2=“+”‘“+V2+”’" AND C3 = ‘+"’“+V3+'”')
This will give you array of rows that are having matching records for given values
Now create a Rownumber variable with int type ex:Rownum
Use
Assign activity
Rownum = DT1.Rows.index(DRarray(0))
Now use
Assign activity
V4 = DT1(Rownum)(C4).tostring

not passing it correctly?

@vinay_reddy Hi Vinay, Could you please share with me a dummy xml file with this logic. im creating mistake in my var passing

Hi @DikshaSK,

1.You can read the excel using the read range activity…
2.That Data Table you can get the columns names by DataTableName.columns.
3.Then you can check this list of this column names with the 4 variables V1 ,V2,V3 & V4…
4.if the 3 variables match you can take the 4th variable…

If it is useful mark it as solution and close the thread…
Any doubts let me know…

Cheers.
Vashisht.

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