I am a beginer of UiPath.
In my current training case of UiPath robot, I am trying the following steps:
- Read one text from IE browser into a variable v1.
- Read one text from one Excel file into a variable v2.
- Compare these two variables by using FlowDecision.
- Do something according to the comparison result.
Now, step 1) and 2) are OK. Step 3) encountered a problem that is confusing.
Two varaibles with same values are always judged as “not equal”.
I confirmed their values in log messages. They are the same.
And I tried “Trim”, “Contains”, “Equals” upon v1 and v2…All of them don’t work.
Expressions like “v1=v2”, “v1.Trim.Equals(v2.Trim)”, “v1.Trim.Contains(v2.Trim)”, “v1.ToString()=v2.ToString()”…don’t work.
For v1 and v2, I tried “String” or “GenericValue” types.
And, the text values are not ANSI characters but Chinese or Japanese ones. e.g., “北海道”.
Could anyone please give any help? Thanks in advance.
2019/09/11 17:50 (UTC+8 Beijing Time) Latest Information:
Everybody, thanks for all of your help. After several hours struggling with this issue, the reason was found.
The string from IE starts with a utf-8 BOM header(0xEFBBBF) while the one from Excel doesn’t. So the comparsion always failed. Both “=” and “Equals()” can’t work in this scenario.
As a temp workaround, I used “v2.Contains(v1)” currently. (v2 has BOM so it is bigger than v1).
In UiPath, I don’t know how to remove the BOM header easily yet.
If you have some information, please let me know. Thanks again.