Grater than If condition is not working

Hi Team,

If condition goes wrong I’m fetching value 1 from Excel and value 2 from using get text activity both value compare if value 1 is greater than value 2 then select discount drop-down and value 1 is less than then value 2 then select loading drop-down.

But my condition is going wrong it always goes to the else part

Hi @Rupali_Shinde

Please share the Screenshot of the code.

regards
Loveleet Saini

HI @Rupali_Shinde

Welcome to Uipath community

Have you tried like this in the If activity

Excelvalue.Trim>GetTextValue.Trim

Check out the XAML file

GreaterThanAmount.xaml (6.4 KB)

Regards
Gokul



HI,

Please note that string comparison is not same as numeric comparison.

For example, “9” > “11” is True, because it evaluate as character code based.

So if you compare string which means numeric, please use the following expression.

CDbl(var1.Trim) > CDbl(var2.Trim)

Regards,

Try with trim in the output value @Rupali_Shinde

Ok ,i will try and let u know.

Thanks

Change your variable data type to Int from the string, so that your comparison will work fine for you.

Note: when you will compare values in if don’t use " " with the variable name because we don’t use " " in integers comparison.

It’s working.

Thanks for support.

1 Like