Hi team,
I am having one scenario where I need to filter a Excel column using the one value.
Example, I a have a value let’s say the value is sreenivasa and I need to check in a excel column 0 for this value.
if this is present in Excel it should be true otherwise this should false.
Kindly help me on this scenario with Linq,
Thanks
Happy Automation
lrtetala
(Lakshman Reddy)
2
Hi @srinusoft37
Can you try this
isValuePresent = dtExcel.AsEnumerable().Any(Function(row) row.Field(Of String)("columnName").Equals("sreenivasa", StringComparison.OrdinalIgnoreCase))
Cheers!!
1 Like
vrdabberu
(Varunraj Dabberu)
4
Hi @srinusoft37
Try this:
Assign activity:
isValuePresent = dtExcelData.AsEnumerable().Any(Function(row) row.Field(Of String)(0) = "sreenivasa")
Regards
1 Like
mkankatala
(Mahesh Kankatala)
5
Hi @srinusoft37
- Assign -> Bool_Var = dt_Input.AsEnumerable.Any(Function(X) X("Column 0").toString.Equals("sreenivasa"))
Note - Bool_Flag is the boolean datatype variable
Hope it help!!
1 Like
Thanks for Quick reply,
All 3 are working as expected.
3 Likes
mkankatala
(Mahesh Kankatala)
7
It’s my pleasure… @srinusoft37
Happy Automation!!
system
(system)
Closed
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.