Variable value comparision

Hi All,

if variable value is less than 25 then goto true part else exit in UiPath.

Strvalue<=“25”

the above condition is not working, always it is skipping true part.
Any suggessions how to check the value.

Thanks in advance,
niranjan

Hi @Niranjan_k

Change the condition as below,

Cdec(Strvalue)<=25

You cannot use less than or greater than operators for strings you have to convert it to integer, double or decimal then check the conditions.

Hope it helps!!

Hello @Niranjan_k , you will need to convert the string to Int in your If statement condition using Convert.toInt32(Strvalue) < 25 but please note that =< is “Less than or equal to” and < is “Less Than”

In your else statement, you can call a Terminate Workflow activity if you want to end the workflow immediately.

1 Like

if you wanted to do a value comparison use following

Strvalue < 25

1 Like

Hello @Niranjan_k ,

to compare integer values you should convert them to int and to compare them, directly write values instead of adding inverted commas

For value is less than 25, use below expression

Cint(Strvalue) < 25

cheers!

1 Like

Hi @Niranjan_k

If Convert.ToInt32(Strvalue) <= 25 Then
(True part)
Else
(Exit or False part)
End If

You can try this also.

1 Like

Hi
Try this will work

Cint(StrValue)<=25

dont use " that will convert it to String

Thanks

1 Like

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