Check DataTable contains value or not

Hi All

I am new to UiPath and excel automation.
I am building a robot which is suppose to take id number as input from user and based on that need to update values in excel.

Now before i do the excel update part, need to check User’s entered id is present or not.

Not able to figure out what to write in the if condition.
tried row(“ID”).tostring.contains(ID), but not working

Find rows with matching ID

Assign (Array of DataRow)
Results = InitialDT.Select(String.Format("ID='{0}'", ID))

If more than 0 match, ID is found

Assign (Boolean)
isFound = Results.Length > 0

You can probably work directly on the Array.

1 Like