Getting the error as - option strict on disallows implicit conversions from 'string' to 'boolean'

Hi All,
I am facing the below error while try to search the string in datatable.

Hi @maxxmuthu

Your condition seems to be wrong…

You should mention the column which you want to search for the value in your data table in the for each row loop if condition

Try this for the condition for your IF activity
row("YourColumnName").ToString.Contains("Automation and Robotics")

Replace “YourcolumnName” with your column name in your data table.

If this works for you… please mark the answer as the solution so that it could help others too…

1 Like

Hi,

There is no column name. So i just mention the column index but it doesn’t work.
PFA… i need to read the ‘output’ file. To check the first column and verify the string ‘Automation and Robotics’ whether it is match. if it is matches then i have to copy the corresponding url.

Output.xlsx (9.6 KB)

Hello @maxxmuthu,

Why don’t apply like this.

image

Regards
Balamurugan.S

1 Like

Hi @maxxmuthu,

I checked you xl. you can apply like this

row.Item(0) IsNot DBNull.Value AndAlso row.Item(0).ToString().Contains("Automation and Robotics")

Regards
Balamurugan.S

1 Like

Also try

`row(0).ToString.Contains("Automation and Robotics")`
1 Like

Hi @balupad14

I checked this syntax - ‘row.Item(0).ToString().Contains(“Automation and Robotics”)’
it seems like it is working. Will this work if there is any space in end/start of the string ?

And also can you please explain how to use this one - ‘row.Item(0) IsNot DBNull.Value’ with string match ?

Hi @maxxmuthu,

First one you can check like this .

 "row.Item(0).ToString().Trim().Contains("Automation and Robotics")"

For string you can check like this

"strValue IsNot Nothing"

Regards
Balamurugan.S

2 Likes

Thanks a lot @balupad14 . It works well . Thank you so much.

Thanks to you too @Lahiru.Fernando for the suggestion.

2 Likes

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