To check if row contains more than one code


After scrapping the value and write it to excel file , I want to check if row(0) contains multiple code like (h1, h4,h6) i want to proceed .

I’m not sure how to write in if condition row(0).toString={“h1”, “h4”}

–seems not valid. can anyone help

Use condition like:

row(0).toString.contains(“H1”) and row(0).toString.contains(“H4”)

Try this instead of row(0).tostring={“H1”,“H4”}.

let me know if any error


hi, it’s not working… It doesn’t show any error, but in web table it doesn’t change any value for h1 and h4 code

You want to change value if condition true or not.
Please send dummy excel if possible

After scrapping row(0) contains h1, h4,h6,h8 … I want to check only two values if row(0) contains h1 and h4 then in webtable change value…
Please check screenshot

Then part of If Activity use Use write cell Activity for Update Excel.
Inside For Each Row Activity use Index Number and ,Use If activity with above condition and in then Part Use write cell using Index Num

value is written to webtable to excel successfully… after that I want to compare excel data to webtable … ONLY i need to validate if condition…I’ve done this way

  1. Data scrapping
  2. write to exel
  3. Foreach row in ExtractData Table
  4. if row(0).toString={“H1”,“h4”}

Only in 4th step there is error… If I use row(0).tostring=“H1” alone it’s working fine …
But When i add extra value it’s not working

p.s: this also not worked row(0).toString.contains(“H1”) and row(0).toString.contains(“H4”)

Anyone help?

row(0).toString.contains(“H1”) or row(0).toString.contains(“H4”)

Thanks , it worked

Let me know if any other doubt

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