How to check if row exist in data table and check if it contain value

Hi ,

I have a datatable, like below

image

How to check if datatable contain “SEC_Min_Val” row and if it is present and how do I fetch its value.

like for eg “SEC_Mul_Nom” has 1000 . how do I fetch value of 1000 for “SEC_Mul_Val” row.

Thanks in Advance

Convert Data table to Dictionary, Version as key, form as value…then u can call key you will get value

Hi @hemasai.06

You can try with lookup data table activity

Check out the links

https://docs.uipath.com/activities/other/latest/user-guide/lookup-data-table

Hey,

You could use Lookup datatable activity.

Also, if you want to search directly in excel you can use Find/ Replace Value from Modern activities.

Hi @Gokul001 ,
I there any way other than look up datatable activity since value is not constant to provide in Lookup Value,
Currently I am trying with these formula to check if row present in datatable - string.Join(“,”,row.ItemArray).Contains(“SEC_Min_Val”)

I am using below formula to check if it contain any value, but something is not working here
string.IsNullOrEmpty(row(“SEC_Min_Val”).tostring)

Hi @hemasai.06

Firstly you can download the database package from manage package
then connect you file using below connection string

“Provider=Microsoft.ACE.OLEDB.12.0; Data Source=C:\Users\RPA_Creator_2\Documents\UiPath\Solution\Data\Input.xlsx; Extended Properties=‘Excel 12.0 XML; HDR=YES; ReadOnly=False’”

C:\Users\RPA_Creator_2\Documents\UiPath\Solution\Data\Input.xlsx replace this your file path

use this provider name “System.Data.OleDb”

then use run query activity, in run query activity use below query
“Select * from [Sheet1$] where [Form] is not null and [Version]=‘Sec_Min_Value’”

then write this datatable in new file using write range activity.

I think it will be help you.