# What do the text blocks fit into?

**URL:** https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002
**Category:** Questions about Thunkable X
**Created:** [November 30, 2019, 6:07pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002 "2019-11-30T18:07:30Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![jordanklu88y](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jordanklu88y](https://community.thunkable.com/u/jordanklu88y)
#### Post date: [November 30, 2019, 6:07pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/1 "2019-11-30T18:07:30Z")

</div>

Hello everyone! This is my first time not only using the website, but posting on this community so please be nice. I am confused on what the “in text ‘abc’ find the first occurrence of text ‘b’” block fits into. I am trying to fit it into a “if, then” block (in the “if” part) and it’s not working, so maybe that’s not how you do it. I am trying to get an alert to show up ONLY IF a keyword is said in a label/description. For example, if the description is “a green sign with white text” and the kay word is green, an alert will show up. But if the description is “a blue sign with white text” no alert will show up. I know that you need the block “label =/= keyword” but I am confused on how to get the app to know what the keyword is, which I think is where the block 'in text ‘abc’ find first occurrence of text ‘b’" comes in, but once again I don’t know where to put the block. Thank you so much for your help!

---

<div class="post-metadata">

### Author: ![Sofia](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sofia/32/50160_2.png) [@Sofia](https://community.thunkable.com/u/Sofia)
#### Post date: [November 30, 2019, 6:30pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/2 "2019-11-30T18:30:54Z")

</div>

Hey @jordanklu88y!

Welcome to Thunkable!  
As for your question let’s go topic by topic.

> [@jordanklu88y](#):
>
> I am confused on what the “in text ‘abc’ find the first occurrence of text ‘b’” block fits into.

If you hover through a block you can find notes on what the block does. In this chase the particular block you’re using it returns a number. If the value is not found you get a 0. So you can attach it to anything that takes a numeric value like a variable, conditionals, sums, etc.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/3/e375301b57b21d37f7d89cf1b06aba73548077b0.png)

> [@jordanklu88y](#):
>
> I am trying to get an alert to show up ONLY IF a keyword is said in a label/description.

How you can incorporate it in a IF statement is this way:

- First you need something to compare it, this kind of blocks are in the logic section, I chose different to 0.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/7/7788237aec3c32ce053f750f2ba33aeb028646ae.png)

Hope it helps! 🙂

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [November 30, 2019, 6:55pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/3 "2019-11-30T18:55:41Z")

</div>

Hello,

![изображение](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/6/9686c5967e7feeae48f9b1b4435b45cac565d8ed.png)

Best regards, Alex  
[ACtech demo project](https://x.thunkable.com/projects/5d70f93f8a62b4079eedaff2/project/properties/designer/)  
[Thunkable X Basic Programming Course](http://droidscript.ru/main/title_ds15.php)  
[Block Reference](http://droidscript.ru/main/statyi/thunkableios_blockhelper.php)  
[Component Reference](http://droidscript.ru/main/statyi/thunkableios_objects.php)  
[Bug tracker](https://x.thunkable.com/projects/5dbd5243a77acad1b26f851f/project/properties/designer/)

---

<div class="post-metadata">

### Author: ![jordanklu88y](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jordanklu88y](https://community.thunkable.com/u/jordanklu88y)
#### Post date: [November 30, 2019, 8:42pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/4 "2019-11-30T20:42:49Z")

</div>

Hello! I really appreciate the help, but the coding you gave me is unfortunately not working. What am I doing wrong? Here is a screenshot of my work. Please respond as quickly as possible! Much love, Jordan

 ![2019-11-30](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/7/b7484ce32392992fa913adbbb204d3cceeb0e2a7.png)

---

<div class="post-metadata">

### Author: ![Sofia](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sofia/32/50160_2.png) [@Sofia](https://community.thunkable.com/u/Sofia)
#### Post date: [November 30, 2019, 9:03pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/5 "2019-11-30T21:03:04Z")

</div>

Hey!

Ok, first of all you don’t need the function (purple block) and the variable number that was just an example so you can see what the block does.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/d/9d80e193f9cc21a8327792dcedc0b96bb43423d6.png)

I copied your code and it works, I tested it on my iPhone. Make sure your device is working properly 🙂 It might be an issue that you’re not refreshing it properly, the app is not up to date, there might be some permissions you have to agree to, etc.

---

<div class="post-metadata">

### Author: ![jordanklu88y](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jordanklu88y](https://community.thunkable.com/u/jordanklu88y)
#### Post date: [November 30, 2019, 9:22pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/6 "2019-11-30T21:22:33Z")

</div>

Hello again! I followed your coding exactly and it still shows an alert no matter what the description is. I did let the app load and refresh. I am very confused. If the description is “a family smiling for the camera” it still shows an alert, even though the coding says to only allow it if it contains green. Heres another screenshot. Thank you for your help but it is still not working  
☹

 ![2019-11-30 (2)](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/6/f6dd55fb1fe37a3d32e9fc3c2fcbfecba8c98c3a.png)

---

<div class="post-metadata">

### Author: ![jordanklu88y](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jordanklu88y](https://community.thunkable.com/u/jordanklu88y)
#### Post date: [November 30, 2019, 9:42pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/7 "2019-11-30T21:42:24Z")

</div>

Please respond as quickly as possible! My deadline is today and this is the last thing I need to do and you are the only one helping me.

---

<div class="post-metadata">

### Author: ![Sofia](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sofia/32/50160_2.png) [@Sofia](https://community.thunkable.com/u/Sofia)
#### Post date: [November 30, 2019, 9:44pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/8 "2019-11-30T21:44:38Z")

</div>

It still shows an alert because you hard coded the variable to be ‘A green sign with white text’ you need to take the input from a text input or if you’re using microsoft’s image recognizer that.

For example I did the following code with a text input:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/f/1f2f747a755a64ff8ddba1e5b80b3be6b719d322.png)

I recorded a video to show you it does work.

> **[RPReplay\_Final1575149608.MP4 (video)](https://drive.google.com/file/d/11DIDeX22vNQOT_v06-ZTNoQqmNhPrrd5/view?usp=drive_open)**
>
> Google Drive file.

---

<div class="post-metadata">

### Author: ![jordanklu88y](https://avatars.discourse-cdn.com/v4/letter/j/e99b99/32.png) [@jordanklu88y](https://community.thunkable.com/u/jordanklu88y)
#### Post date: [November 30, 2019, 11:37pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/9 "2019-11-30T23:37:27Z")

</div>

Thank you so much! You literally saved my project!

---

<div class="post-metadata">

### Author: ![Sofia](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/sofia/32/50160_2.png) [@Sofia](https://community.thunkable.com/u/Sofia)
#### Post date: [December 1, 2019, 6:24pm UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/10 "2019-12-01T18:24:01Z")

</div>

Cool! 🙂 Glad to help! Would you mind checking the post that helped you the most as the answer to your question?

Thank you!

---

<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, 11:46am UTC](https://community.thunkable.com/t/what-do-the-text-blocks-fit-into/345002/11 "2024-11-08T11:46:32Z")

</div>


