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âŚ
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.
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
Also try
`row(0).ToString.Contains("Automation and Robotics")`
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
Thanks a lot @balupad14 . It works well . Thank you so much.
Thanks to you too @Lahiru.Fernando for the suggestion.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.