# If block is not working

**URL:** https://community.thunkable.com/t/if-block-is-not-working/3396131
**Category:** Issues / Bugs
**Created:** [December 7, 2024, 5:45am UTC](https://community.thunkable.com/t/if-block-is-not-working/3396131 "2024-12-07T05:45:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![snehcharki61ohlp](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@snehcharki61ohlp](https://community.thunkable.com/u/snehcharki61ohlp)
#### Post date: [December 7, 2024, 5:45am UTC](https://community.thunkable.com/t/if-block-is-not-working/3396131/1 "2024-12-07T05:45:42Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/1/c1230d11e05fb13577297222a8147ab27aed7c82.png)  
Hi Thunkable,  
I am a Student and first time user from India.  
This is the sequences of operation. I am printing the values.

1. MoveLiftTo = 12, LiftPos = 0,
2. I call the function MoveLift. Right now MoveLiftTo is \> LiftPos
3. We go to the Do part of the If block and print Greater than
4. We save the current Lift Position in LiftPos
5. Everything works fine
6. Now I set MoveLiftTo = 3
7. Now I see it prints out MoveLiftTo = 3, LiftPos = 12
8. Instead of going to else part it again goes to the Do part & prints Greater than
9. I have set the keyboard to Numeric for the MoveLiftTo input & LiftPos is a app variable.
10. Please Advice me why the if logical block is failing.  
Thank u very much,  
Regards Sneha

---

<div class="post-metadata">

### Author: ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)
#### Post date: [December 7, 2024, 6:38am UTC](https://community.thunkable.com/t/if-block-is-not-working/3396131/2 "2024-12-07T06:38:25Z")

</div>

Hi and welcome to Thunkable!

You can’t compare text strings as numbers. So checking to see if “3” \> “12” doesn’t really mean what you think it should mean. You need to convert both strings to numbers. The way to do that in Thunkable is to add zero to each one (the text input’s text and the cloud variable). Then you can compare them with logical/mathematical symbols such as \>.

---

<div class="post-metadata">

### Author: ![snehcharki61ohlp](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@snehcharki61ohlp](https://community.thunkable.com/u/snehcharki61ohlp)
#### Post date: [December 8, 2024, 5:07am UTC](https://community.thunkable.com/t/if-block-is-not-working/3396131/3 "2024-12-08T05:07:07Z")

</div>

**Thank you very much Sir**  
It works perfectly. Now I know how to convert strings into numbers  
Best regards  
Sneha
