If condition greater than

hi experts,

I am trying to use If function. if the amount is less than x, perform activity A. if the amount is more than x, perform activity B.

somehow it doesn’t work.



If you show us the error you get specifically it will be easier to help. Make sure you have defined the variable “amount”, make sure it’s an integer not a string, and make sure you gave it an initial value somewhere in your sequence, before it reaches the if conditon


What error are you getting ?

Is Amount variable is of type Integer or not ?

hi @AkisM

there’s no error encountered. it just that the bot keep choosing the wrong task to perform when I set the condition amount <5000, perform task A. else, perform task b

@lakshman amount is int32


Before IF condition, take one Message box Activity and print like amount.Tostring and then check once.

1 Like

Hi buddy @Popo
you were almost done.
only thing we need to check now is the value of the amount variable
The reason is
–well its int32 - good
–if condition is entered correctly – good
–amount is not empty, else we will be thrown with error object reference is null – so good again

So finally only thing left is the value of the amount and we need to check whether it is < 5000
–For that we can use a write line activity or log message activity and check with the value of the amount…
–Use a write line activity before to this if condition and mention the value as

This will display the value of the amount in output panel, kindly check with that and share the screenshot buddy
This can be easily resolved
Cheers @Popo

1 Like

the bot still continue to perform the wrong task.

Hey @Popo,

I just had a look on the attached xaml.Is it the entire flow you have?

Because the amount variable is not intialized anywhere.

yes. that’s my entire flow. how do I make the amount as a variable? use assign activity?

Hey @Popo
In the variable pane this amount variable is already declared but does not have any default value.

try to assign it a value let say 50 in the variable pane and let me know the results.

the bot still chooses the wrong task btw else and then

@Palaniyappan @amarasto

the amount could range from 0 to 4999.99. does it means I can’t change the variable to INT?


Then in IF condition try like this:

Cdbl(amount) < 5000

it still chooses the wrong task. when the amount in my excel is more than 5000, it chooses the task that is less than 5000, which is wrong. the bot should choose task that is more than 5000


Amount is coming from Excel sheet ?

Could you please take screenshots of the your process and show me once. Will check and update you.

yes, bot to check amount from excel sheets. sorry I didn’t make it clear earlier.


Sorry I am not able to open this file and seems like some packages got corrupted. Could you please send me zip format along with project.json file.

let me know if you can open it. if not. I will send the screen shots.


As you said, amount is coming from excel value. Try below one in IF condition.

If column name is amount then try this: Cdbl(row(“amount”).Tostring) < 5000