# Text Output When Clicking a Button

**URL:** <https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545>\
**Category:** Questions about Thunkable X\
**Tags:** beginner, textinput\
**Created:** [February 2, 2024, 2:20pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545 "2024-02-02T14:20:41Z")\
**Posts on this page:** 20\
**Page:** 3

<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:** [February 9, 2024, 4:11pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/41 "2024-02-09T16:11:50Z")

</div>

This is also not right. Now you’re trying to get the value of an app variable with the name of the _value_ from app variable USER CLICK. Delete the app variable block from in front of that one:

 ![Screenshot 2024-02-09 at 8.12.10 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/0/8055c0eb9eb24394117a9270051c6679241f1d6d.png)

---

<div class="post-metadata">

**Author:** ![kochtgrw](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kochtgrw/32/166832_2.png) [@kochtgrw](https://community.thunkable.com/u/kochtgrw)\
**Post date:** [February 9, 2024, 4:16pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/42 "2024-02-09T16:16:43Z")

</div>

> Blockquote This is also not right. Now you’re trying to get the value of an app variable with the name of the _value_ from app variable USER CLICK. Delete the app variable block from in front of that one:
> 
> ![Screenshot 2024-02-09 at 8.12.10 AM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/8/0/8055c0eb9eb24394117a9270051c6679241f1d6d.png)

ok I did that now but still it’s not working, now it doesn’t crush but the result I get in the screen says “undefined”

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [February 9, 2024, 4:20pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/43 "2024-02-09T16:20:55Z")

</div>

As @tatiang said you are using a string variable with a list block.  
If I remember right the variables are valid for all screens, so if you declare in screen 1 you haven’t to do this again in screen2 .  
Use dufferent screen only if it’s really necessary

---

<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:** [February 9, 2024, 4:22pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/44 "2024-02-09T16:22:32Z")

</div>

Post a link to your project because it’s hard to troubleshoot this with limited information.

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [February 9, 2024, 4:26pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/45 "2024-02-09T16:26:17Z")

</div>

> [@Goldking](#):
>
> ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/9/a9361170e8e191cf2fadee9d4408498dbe52e6b3.png)

If you want to use my block you have to copy in the right way

---

<div class="post-metadata">

**Author:** ![kochtgrw](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kochtgrw/32/166832_2.png) [@kochtgrw](https://community.thunkable.com/u/kochtgrw)\
**Post date:** [February 9, 2024, 4:27pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/46 "2024-02-09T16:27:35Z")

</div>

@ [tatiang](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/44) Post a link to your project because it’s hard to troubleshoot this with limited information.

sure here it is [Thunkable](https://x.thunkable.com/projectPage/65c64368a5670f238dfcb8f3)

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [February 9, 2024, 4:34pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/47 "2024-02-09T16:34:51Z")

</div>

![Screenshot 2024-02-09 175250~2](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/b/1b091aed64e5b175afc8003eccfb343a3a3fc9ef.png)

Copy the block item click like mine , then add in settings **Your native language** as I said you

> [@Goldking](#):
>
> You can add a text in the setting , fill the empty string at top and click add text items
> 
> ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/6/e62d71269adb6720bbb7c5df10e6b49246ed3112.png)
> 
> the

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [February 9, 2024, 4:40pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/48 "2024-02-09T16:40:43Z")

</div>

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

Try to use only one screen, with container and layout you can simulate screens

---

<div class="post-metadata">

**Author:** ![kochtgrw](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kochtgrw/32/166832_2.png) [@kochtgrw](https://community.thunkable.com/u/kochtgrw)\
**Post date:** [February 9, 2024, 4:43pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/49 "2024-02-09T16:43:30Z")

</div>

> [Goldking](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/47) Copy the block item click like mine , then add in settings **Your native language** as I said you

I am more confused now. The app has 2 screens, not 1. Did you check the project as I shared it above to get a better idea how what it looks like? Here it is again [Thunkable](https://x.thunkable.com/projectPage/65c64368a5670f238dfcb8f3)

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [February 9, 2024, 4:47pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/50 "2024-02-09T16:47:24Z")

</div>

You really need 2 screens?

> [@Goldking](#):
>
> Try to use only one screen, with container and layout you can simulate screens

Anyway in screen 1 add variables and screen1 starts, and simple list, in screen 2 bn\_add code

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [February 9, 2024, 5:02pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/51 "2024-02-09T17:02:34Z")

</div>

[https://x.thunkable.com/projectPage/65c65880a5670f238d031449](https://x.thunkable.com/projectPage/65c65880a5670f238d031449)

I don’t know if you can color only the cliked item, probably no

---

<div class="post-metadata">

**Author:** ![kochtgrw](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kochtgrw/32/166832_2.png) [@kochtgrw](https://community.thunkable.com/u/kochtgrw)\
**Post date:** [February 10, 2024, 11:18am UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/52 "2024-02-10T11:18:23Z")

</div>

Thanks but now the initial screen doesn’t work properly. The options list must show initially “Your Native Language” so that users know what this is about and when they click one of the options, only this option should appear (as it is in my example)

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [February 10, 2024, 11:48am UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/54 "2024-02-10T11:48:06Z")

</div>

So you want after click to show only one item in the list ?

Add **simple list text items to item** under variable user click. Probably I forgot it

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [February 10, 2024, 12:02pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/55 "2024-02-10T12:02:28Z")

</div>

You could like this way too.  
If you have “your native language” after click show the list  
if you have a list, after click select item and show also the back option  
if you click back option go back to menu

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

---

<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:** [February 10, 2024, 6:08pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/56 "2024-02-10T18:08:40Z")

</div>

Here’s how I would do this:

[https://x.thunkable.com/copy/fb5da20959a1f527f2a89c7e412174c0](https://x.thunkable.com/copy/fb5da20959a1f527f2a89c7e412174c0)

If you want to highlight only the selected language, you will need to use a Data Viewer List instead of a Simple List.

**Screen 1**

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/2/02e644075eaa8909d082f2907d4c80f1d13646e9.png)

**Screen 2**

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

---

<div class="post-metadata">

**Author:** ![kochtgrw](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kochtgrw/32/166832_2.png) [@kochtgrw](https://community.thunkable.com/u/kochtgrw)\
**Post date:** [February 12, 2024, 3:27pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/57 "2024-02-12T15:27:44Z")

</div>

@ [tatiang](https://community.thunkable.com/u/tatiang) & [Goldking](https://community.thunkable.com/u/Goldking) thanks guys however none of these works properly, I need the list to work as it does in my own project. “Your Native Language” should appear only at the beginning and when the user clicks it the languages should appear. After that when they click one of these languages only this should stay in the screen with different color (as it is in my project link)

---

<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:** [February 12, 2024, 5:45pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/58 "2024-02-12T17:45:55Z")

</div>

Okay, well hopefully what I’ve shared will help you get there. I’m not sure what else to suggest. Some of the work is difficult and requires “painting” a DVL (Data Viewer List). You can search for that on the forums.

---

<div class="post-metadata">

**Author:** ![kochtgrw](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kochtgrw/32/166832_2.png) [@kochtgrw](https://community.thunkable.com/u/kochtgrw)\
**Post date:** [February 12, 2024, 7:15pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/59 "2024-02-12T19:15:10Z")

</div>

OK but that’s why I preferred the simple list in the first place, so what I can I do about the 2nd screen if I keep the simple list in the first one

---

<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:** [February 12, 2024, 7:19pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/60 "2024-02-12T19:19:45Z")

</div>

What do you mean? Can you say more about that? My blocks should still work for Screen 2. I used a Simple List in the demo project.

---

<div class="post-metadata">

**Author:** ![kochtgrw](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kochtgrw/32/166832_2.png) [@kochtgrw](https://community.thunkable.com/u/kochtgrw)\
**Post date:** [February 12, 2024, 7:53pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/61 "2024-02-12T19:53:55Z")

</div>

sorry I thought that it wasn’t. Anyway why the following variable in your code is incomplete?  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/5/a59981da27d8d8438a6badef9f14496920d17c54.png)

Also have in mind that the final app will have multiple languages options for the list so since your code now for the text output in the 2nd screen allows only 2 options with the “if else” blocks what should change for example for an 8 options list.

Check my blocks for the first screen to see how it is for 8 options and what changes should I make to connect it with the 2nd screen (the design though and function of the 1st screen should stay the same)

 ![Screenshot 2024-02-12 215207](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/f/af2cc0b7ddb5c1430d169e2ef454fb8082d3d72c.png)

[Previous page](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545.md?page=2)

[Next page](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545.md?page=4)
