# Text to Integer

**URL:** <https://community.thunkable.com/t/text-to-integer/1040784>\
**Category:** Questions about Thunkable X\
**Created:** [December 22, 2020, 9:33pm UTC](https://community.thunkable.com/t/text-to-integer/1040784 "2020-12-22T21:33:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryansabin](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@ryansabin](https://community.thunkable.com/u/ryansabin)\
**Post date:** [December 22, 2020, 9:33pm UTC](https://community.thunkable.com/t/text-to-integer/1040784/1 "2020-12-22T21:33:43Z")

</div>

I get a string with the following format “b7,s250,r100,b17,g12”

I convert the string to a list and then run through a for each loop. I have an if then for each list item. I then need to set a slider to the corresponding value. No matter what I try I am not allowed to use a substring as the value for a slider.

I have tried using the math function “+0” and “\*1”. Neither of these will accept the substring either.

 ![TextToInteger](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/1/c15cb6092c0464a084dbffd52f36898a22657122.png)

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [December 22, 2020, 10:03pm UTC](https://community.thunkable.com/t/text-to-integer/1040784/2 "2020-12-22T22:03:34Z")

</div>

Give this a try  
**Blocks**

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/5/c58e281965494585e7904cbcd93472289f3762f7.png)  
**Results**  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/b/fb058445049fb6d7341c2419c30a5d2b336570d9.png)

---

<div class="post-metadata">

**Author:** ![ryansabin](https://avatars.discourse-cdn.com/v4/letter/r/e47c2d/32.png) [@ryansabin](https://community.thunkable.com/u/ryansabin)\
**Post date:** [December 22, 2020, 11:26pm UTC](https://community.thunkable.com/t/text-to-integer/1040784/3 "2020-12-22T23:26:26Z")

</div>

I was able to resolve the issue by saving the substring to an app variable. Then using that as the value. Its a poor workaround. But, it worked.

 ![Solution](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/0/a0056f51a48e188da78334f1d5a08cd5cf7e8324.png)

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 12:19pm UTC](https://community.thunkable.com/t/text-to-integer/1040784/4 "2024-11-08T12:19:33Z")

</div>


