# 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:** 4

<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:56pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/62 "2024-02-12T19:56:29Z")

</div>

also what should I change in the 2nd screen for the content to appear as indexed in the table and not random?

---

<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 12, 2024, 10:52pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/63 "2024-02-12T22:52:06Z")

</div>

> [@Goldking](#):
>
> [Thunkable](https://x.thunkable.com/projectPage/65c65880a5670f238d031449)

I show you the code and the project and how to modify

> [@Goldking](#):
>
> Add **simple list text items to item** under variable user click. Probably I forgot it

And also showed you another code to set also back function

> [@Goldking](#):
>
> You could like this way too.

You have all the information to create your code

---

<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, 11:44pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/64 "2024-02-12T23:44:30Z")

</div>

Variables do not always need to have an initial value. I often leave them blank. But you can connect an empty list variable if you like.

The way I set up the demo, the code is dynamic. That means that it’s the same number of blocks whether you have 3 languages or 30 languages. The way you’re coding it is static meaning that each time you add a new language, you have to add or change a bunch of blocks.

If my method doesn’t make sense to you then I would recommend sticking to what you already have. I realize you wanted some features to work differently… I simply used what was faster and more efficient. You can, of course, use parts of the demo that are useful and ignore others.

---

<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 13, 2024, 3:40pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/65 "2024-02-13T15:40:54Z")

</div>

Thanks guys and sorry for being a pain! I managed to make it work for random text to appear (from each type) but even though I tried many things for getting text according to how it ranks on the data table I couldn’t make it work. Also, when the user closes the app, the app should remember which was the last content it showed and when it begins again start from the next text

---

<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 13, 2024, 10:11pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/66 "2024-02-13T22:11:49Z")

</div>

I won’t have the time to help with each step of your project but I can pop in from time to time and answer questions. You might consider hiring someone to help if there’s any rush to getting this done.

---

<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 14, 2024, 9:23am UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/67 "2024-02-14T09:23:32Z")

</div>

> [@kochtgrw](#):
>
> to how it ranks on the data table

So you don’t want it random?

> [@kochtgrw](#):
>
> when the user closes the app

you have to use [stored variable](https://docs.thunkable.com/blocks/blocks/variables-overview#stored-variables), I recommend you to read the [DOCS](https://docs.thunkable.com/) ,for the basic questions, or search in the community before ask. How can you work on your project if you don’t even know the variables?

---

<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 14, 2024, 2:07pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/68 "2024-02-14T14:07:39Z")

</div>

> [@Goldking](#):
>
> So you don’t want it random?

I am not sure yet so I need to know how can I make it ranked too

---

<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 14, 2024, 2:37pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/69 "2024-02-14T14:37:20Z")

</div>

> [@kochtgrw](#):
>
> but even though I tried many things for getting text according to how it ranks on the data table

Show your block, it’s not possible you are not able to do this, you can find the solution in our chat too.  
If you don’t want to read Docs about basic questions then show me what you tried and I will set you on the way to

---

<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 15, 2024, 11:30am UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/70 "2024-02-15T11:30:57Z")

</div>

> [@Goldking](#):
>
> Show your block, it’s not possible you are not able to do this, you can find the solution in our chat too.  
> If you don’t want to read Docs about basic questions then show me what you tried and I will set you on the way to

you can check here one of the things I tried and doesn’t work [Thunkable](https://x.thunkable.com/projectPage/65cb76a6c8f02ed6cad89825)

---

<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 15, 2024, 3:05pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/71 "2024-02-15T15:05:14Z")

</div>

Yes but as I said you I’m not always at laptop so you have to wait . If you show a pic of your code I can help you everywhere I am.

---

<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 16, 2024, 6:04pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/72 "2024-02-16T18:04:15Z")

</div>

I took a look at your code, why you didn’t copy our project or studed them?  
You have to change only the block under create poeme from random to select item

> **[Lists Blocks](https://docs.thunkable.com/blocks/blocks/lists#get-get-and-remove-or-remove)**

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

---

<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 17, 2024, 2:40pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/73 "2024-02-17T14:40:55Z")

</div>

![one](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/9/19dc94c2a17120953a4f301aba604d7886e93789.png)

You don’t need to download again the data from table if you set variables when screen starts.  
The block I deleted has no sense, try to read it again.  
You are getting and index in te first menu (lenguages) to take an item inside a column, it is PoemX  
With poemX you want to get a row, but as you can see the get row needs an ID an not a casual element

In the second screen this is the block to get an element with index, now is one , you have to manage it as your goal.

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

Here the [PROJECT](https://x.thunkable.com/projectPage/65cfa24d38ab269e4f297a83) but you have to study a lot my friend, the basic knowledge . I studed for months before play with code , I read a lot in the community , I saw a lot of video on youtube.  
Thunkable Team made a lot of video for the community [YOUTUBE](https://www.youtube.com/@Thunkable/featured)

The **stored variable** able you to save the selection inside the app for the next opening  
For the next step:

- You can change the code to open the second screen after selection ( and not after click button)
- If you want to open screen 2 after click button you need a control about the selection , if user click twice the menu he will come back to all the languages and if he clicks to screen 2 the variable CLIK USER will not be correct.
- You can create a code to not show the language selection after the second opening and ,perhaps, you can add a setting page where user can modify the language

Good luck for your 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 19, 2024, 2:12pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/74 "2024-02-19T14:12:40Z")

</div>

Thank you, I tried the above but now when I click the button it shows only the first text, it doesn’t change when I click it again. [Thunkable](https://x.thunkable.com/copy/62d15efc2c0faaa73864de7a3b374917)

Additionally, I noticed another issue. When the text is too long and not all of it appears on the screen you cannot scroll to read the rest, I tried to set the label lines for longer but nothing works so what should I do in these cases?

---

<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 19, 2024, 2:33pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/75 "2024-02-19T14:33:47Z")

</div>

> [@Goldking](#):
>
> In the second screen this is the block to get an element with index, now is one

Yes of course, is always one , If you want it to change you have to use a variable instead of number one and manage this variable as you want.  
Every click set variable+1 to move on by one .

> [@kochtgrw](#):
>
> what should I do in these cases?

Try to add the label inside a Container , set the container scrollable and the label fill container both height and width

---

<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 19, 2024, 2:37pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/76 "2024-02-19T14:37:24Z")

</div>

> [@Goldking](#):
>
> Yes of course, is always one , If you want it to change you have to use a variable instead of number one and manage this variable as you want.  
> Every click set variable+1 to move on by one .

no I don’t mean that. I mean that when I click it again it doesn’t move to the 2nd one, then the 3rd etc. It stays at the first one no matter how many times I click 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 19, 2024, 2:47pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/77 "2024-02-19T14:47:13Z")

</div>

> [@kochtgrw](#):
>
> I don’t mean that. I mean that when I click it again it doesn’t move to the 2nd one, then the 3rd etc. It stays at the first one no matter how many times I click it

Yes as I said , read again .

---

<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 19, 2024, 2:50pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/78 "2024-02-19T14:50:53Z")

</div>

> [@Goldking](#):
>
> Yes of course, is always one , If you want it to change you have to use a variable instead of number one and manage this variable as you want.  
> Every click set variable+1 to move on by one .

What kind of variable?

> [@Goldking](#):
>
> Try to add the label inside a Container , set the container scrollable and the label fill container both height and width

I tried that but it doesn’t work. Here is a screenshot of how the label is inside a container. Let me know if you see something wrong  
 ![Screenshot 2024-02-19 164740](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/5/8/58e9f09798db757713d27d5b86c9e2e23270d01f.png)

---

<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 19, 2024, 3:19pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/79 "2024-02-19T15:19:44Z")

</div>

You set the container and the label as I said for dimensions?

A variable that save the index you want to show

---

<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 22, 2024, 2:55pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/80 "2024-02-22T14:55:34Z")

</div>

I am not sure what you mean. Can you show me an example of how the container and the label should be?

---

<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 22, 2024, 3:01pm UTC](https://community.thunkable.com/t/text-output-when-clicking-a-button/2816545/81 "2024-02-22T15:01:19Z")

</div>

> [@Goldking](#):
>
> Try to add the label inside a Container , set the container scrollable and the label fill container both height and width

I did that even though the “fill container” "or “fill contents” is an option in the container settings, not in the labels settings

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

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