The value is the same but the condition is not met

Hi everybody
I have trouble activities get text when I use it to get the value in select on the web platform to compare with the value in the excel file when comparing the same characters, but it does not meet the condition. Whether replace or trim is not satisfactory. Here is the test file I used to test. This is a company project so I cannot give the whole diagram to you.

Please help what’s going on here

Test.xaml (5.4 KB)

@minhduc

Mention condition like this and then try once.

    test.Equals(test1)

Hi,

I checked your workflow xaml file internally, and I found the value of “test” is set “Jeans?/?Cotton?Pants” as the following.

    <Sequence.Variables>
      <Variable x:TypeArguments="x:String" Default="Jeans?/?Cotton?Pants" Name="test" />
      <Variable x:TypeArguments="x:String" Default="Jeans / Cotton Pants" Name="test1" />
    </Sequence.Variables>

So please re-input “Jeans / Cotton Pants” to test variable in variable panel.

Regards,

Hi Yoichi

I have reviewed the xml file but the value you said doesn’t seem to be because my xml file doesn’t have “?”. I am currently using the community version 2019.10.2

Thank you

Hi Iashman

I tried it but the result was false. Thank you

@minhduc

What about this condition.

        test.Trim.Equals(test1.Trim)

Hi Iakshman

It seems that it still does not work properly. I checked many times, there is no difference between the two variables and also checked the xaml file that Yoichi suggested but the price is still the same. Thank you

1 Like

Hi,

It seems to depend on text editor.

I checked it binary editor, there is non-space data between “Jeans” and “Cotton” as the following.

img20191227-2

How did you input this data?
I think you can solve it re-input data or copy data from test1.

Regards,

@minhduc

It’s weird. Looks like both string values are same only but it’s giving False. As @Yoichi mentioned re input data and then try once.

Hi @lakshman and @Yoichi

Currently I am using activities get text to get the value of the select item on Website company and then compare it with the excel that a user sent to the robot to perform. So copying the value of test1 and paste for test is impossible. Thank you

image

@minhduc

Before of that IF condition put one Message Box activity and print both String values and check it once.

Hi @lakshman

I did what you said earlier and checked, as you can see, the two values ​​are the same. Test the value I get on the company website and Test1 is from the excel user file.

Hi,

In previous post, I suggested there is 0xC2A0 instead of space.
Now, I just found 0xC2A0 is Non-break space in UTF-8 like &nbsp;.

In UiPath it’s identified as not space but ChrW(160). So the following condition returns true.

test.Replace(ChrW(160)," ") = test1

Can you try it?

Regards,

3 Likes

Hi @Yoichi And @lakshman

I tried and succeeded. Thanks for the enthusiastic help from you.

2 Likes

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