In transaction item equals get text variable

Hi All,
I need your help to help me understand why this “if” condition logic is not working as expected.
I am comparing two variables :

  1. in_TransactionItem.SpecificContent(“Cliente”).ToString
  2. Variable “CustomerinAppS” got from text variable activity
    image

    condition:
    (CustomerinAppS.Equals(in_TransactionItem.SpecificContent(“Cliente”).ToString))

Then > message box " Are equal"
Else > message box " Are NOT equal"
But when is executing is always coming back as “Are Not equal” even when they are.
Thank you in advance for your help!

Hi @sergio.palencia

Can you specify what is the text you are getting from CustomerinApp variable?

I think after getting you are getting some extra spaces, try the below syntax once:

CustomerinAppS.ToString.Trim().Equals(in_TransactionItem.SpecificContent("Cliente").ToString)

Regards

Hi vrdabberu,

both of the variables always have the same format XX/XXXX

underlined you can find in the Upper part the in transaction item and in the lower part text from the variable activity
image
Also the result of the the write line activity
I have tried the syntax that you provided but it keeps showing that they are not equal
Thanks

Hi @sergio.palencia

Try this once:

If String.Equals(CustomerinAppS, in_TransactionItem.SpecificContent("Cliente").ToString, StringComparison.OrdinalIgnoreCase) Then
    MessageBox.Show("Are equal")
Else
    MessageBox.Show("Are NOT equal")
End If

Regards

Hi @vrdabberu
Is still not working :


Any other ideas?
Thanks for your help

Hi @sergio.palencia

If 
   (in_TransactionItem.SpecificContent("Cliente").ToString.Trim()).Equals(CustomerinAppS.ToString.Trim())
Then
    MessageBox.Show("Are equal")
Else
    MessageBox.Show("Are NOT equal")
End If

Working well
Thanks a lot !!

Hi @sergio.palencia

You’re Welcome.

Happy Automation!!

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