How to know if the Specific column contains particular value or not

I am reading Complete excel. But I need to write if condition for column F (EMPID) contains S1234. Kindly help me on this?

Hi @srujanch.
Inside the For Each Row activity, add a If activity and use this condition:
row(“EMPID”).ToString.Contains(“S1234”)
Hope this helps :slight_smile:

@srujanch,

can explain little bit more about your requirement so we can help on that.

there are several ways to find out.

  1. if you want to know whether any rows contains value 1234 in eniter datatable
    use filterdatatable activity - under filter rows wizard - give your column name and also the value you looking for so you can find the results.

image

  1. other way is just use select query like DataTable.select("EMPID like ‘$1234’ ")
    Thanks,

Thank you for the Reply. I need to write if condition For the Attached Excel File for Column F. But i need to read entire excelFileToProcess.xlsx (9.8 KB)

Thank you for the Reply. I need to write if condition For the Attached Excel File for Column F. But i need to read entire excelFileToProcess.xlsx (9.8 KB)

I need to write IF condition to check if the F column Has “TBD” or not

Hi,

You can write as,

  1. read the excel data by using read range activity.
  2. use, foreach row and inside the foreach use if condition as “if(row.item(5).equals(“TBD”))” then true, complete your true condition or proceed with your else condition.

Thanks,
Sid

1 Like

can you explain bit more like
what is the next step after you check the IF condition.

After i checked your excel i understood like if the column f has TBD you want to do some actions…

for that you can use my this.

Hi @srujanch,

If you want to do this all in one expression:

(From row in [INSERT dt VAR HERE].AsEnumerable() Select Convert.Tostring(row([INSERT COLUMN NAME HERE]))).ToList().Contains([INSERT MATCHING WORD HERE])

So for instance that could go into an If condition.

I hope this helps…

3 Likes

well I would also like to know how to do certain similar stuffs.
In my case, i need to check if a certain customer has bought the item before or not.
if no, i need to mark * at the bought item column (there are different items, i only need to mark the item bought by the customer rest of the items which customer did not bought should be empty). if it is a yes i have to do nothing.

the thing i can not figure out is how to check weather the customer bought the item before or not because the other sheet2 contains int values (in currency) and the sheet1 which i have to update contains * i need to check both sheet and fill the correct cell