I have a situation where I run a SQL query against the Excel file(using the OLEDB driver) and output the results to the Output DataTable(String1). Then I use remove couple words from this string using the Remove(index), and then I use an If condition to compare the String1 to String2. Unfortunately, the result of the If statement is always False. I used the “Equals” and “=” as well but looks like something is not right. As well I tried to ToLower and ToUpper and it didn’t help as well. The output of both String1 and String2 are exactly the same on the Log Message and Write Line activities. Can you please point me where I might be missing some details?
Hi buddy @Thrall
Can i have a view on the output of string1 and string2
we can get that with writeline activity and share the screenshot of those two values in output panel
We can solve this buddy, you were almost done
Cheers @Thrall
I am wondering if the issue in the way that UiPath threats the strings. Please have a look at the string properties from Output DataTable and the target string which it will be compared.
Fantastic
Kindly try with this and let know buddy matchDTText.ToString.Trim.Equals(fullname.ToString.Trim)
in a if condition and try @Thrall
the reason is there might be some space before or after the strings from table, so we are using TRIM method to remove the empty space that lies before and after the string
This will work for sure buddy
Cheers @Thrall