# How do i take an item from my list in blocks and display that item in a label i've created?

**URL:** https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924
**Category:** Questions about Thunkable X
**Tags:** beginner
**Created:** [June 16, 2023, 4:30pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924 "2023-06-16T16:30:25Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![dragonsblazing19zem9](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dragonsblazing19zem9](https://community.thunkable.com/u/dragonsblazing19zem9)
#### Post date: [June 16, 2023, 4:30pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/1 "2023-06-16T16:30:25Z")

</div>

Hi Thunkers!

I am a beginner working on one of my first projects and i came across a problem.  
i made a list in blocks and the items include quotes, ig , and i wanted to take one of those items  
and display it in the label i had created in my app but it randomly starts changing the text every second. it wont stay one quote and changes rapidly. how do i keep it one at a time?

 ![Screen Shot 2023-06-16 at 7.28.15 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/b/4bca68acb2be9c83a892bba8c9b908ba89b8b6b1.png)  
the image above doesnt show the rapid changing and i cant record it either bu the code:  
 ![Screen Shot 2023-06-16 at 7.30.01 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/c/eca44c3e3c54b80425e17d7c2b89c675e8f0116e.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: [June 16, 2023, 4:33pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/2 "2023-06-16T16:33:08Z")

</div>

Those blocks should only fire when you open the app or navigate back to that screen.

If it’s happening repeatedly and quickly, those blocks don’t explain that behavior.

Can you post a link to your project?

Are you testing in a browser or on a mobile device? If mobile, which device?

---

<div class="post-metadata">

### Author: ![dragonsblazing19zem9](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dragonsblazing19zem9](https://community.thunkable.com/u/dragonsblazing19zem9)
#### Post date: [June 16, 2023, 4:50pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/3 "2023-06-16T16:50:19Z")

</div>

Hi  
i actually found out that i had a code for this in another part of my blocks and that was causing a bug so i deleted those and now its working fine  
Thanks for trying to help tho!

---

<div class="post-metadata">

### Author: ![dragonsblazing19zem9](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dragonsblazing19zem9](https://community.thunkable.com/u/dragonsblazing19zem9)
#### Post date: [June 16, 2023, 4:55pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/4 "2023-06-16T16:55:57Z")

</div>

BUT you can help me by telling me why my label always shows undefined before i navigate to the list screen.  
i want it to show a quote without needing to go there  
heres a link:  
[https://x.thunkable.com/projects/6488896fb8100b197f171013/d06efc78-65a6-4a85-9cd2-599142a5e9ac/blocks](https://x.thunkable.com/projects/6488896fb8100b197f171013/d06efc78-65a6-4a85-9cd2-599142a5e9ac/blocks)

---

<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: [June 16, 2023, 5:29pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/5 "2023-06-16T17:29:07Z")

</div>

Which label on which screen?

---

<div class="post-metadata">

### Author: ![dragonsblazing19zem9](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dragonsblazing19zem9](https://community.thunkable.com/u/dragonsblazing19zem9)
#### Post date: [June 16, 2023, 5:42pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/6 "2023-06-16T17:42:34Z")

</div>

the label thats on the screen i have shown

---

<div class="post-metadata">

### Author: ![dragonsblazing19zem9](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dragonsblazing19zem9](https://community.thunkable.com/u/dragonsblazing19zem9)
#### Post date: [June 16, 2023, 5:43pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/7 "2023-06-16T17:43:10Z")

</div>

i have to press the see all quote/thoughts button b4 i can see quotes on that label

---

<div class="post-metadata">

### Author: ![dragonsblazing19zem9](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dragonsblazing19zem9](https://community.thunkable.com/u/dragonsblazing19zem9)
#### Post date: [June 16, 2023, 5:44pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/8 "2023-06-16T17:44:04Z")

</div>

also its the home page screen

---

<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: [June 16, 2023, 6:13pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/9 "2023-06-16T18:13:19Z")

</div>

You can edit an existing post on the forums instead of adding so many short responses here.

Unfortunately, I can’t remix your project right now so I can’t look at it: [Unble to remix project](https://community.thunkable.com/t/unble-to-remix-project/2470030).

---

<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: [June 16, 2023, 6:37pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/10 "2023-06-16T18:37:54Z")

</div>

The label is undefined because you are asking it to display a list item from a list that hasn’t yet been defined. In this screenshot, `app variable list display` has no value so the list item assigned to `app variable quote` is undefined.

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

---

<div class="post-metadata">

### Author: ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)
#### Post date: [June 16, 2023, 7:03pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/11 "2023-06-16T19:03:05Z")

</div>

not only that - you have to switch the statement 1 and 2 inside the block - ie. you need to get a random index first before you can use it to obtain an item in the app\_variable\_list\_display.

also, the code you have in the allthoughts screen, where you load the thoughts list with the correct set (according to time of day) should be placed in 3 places in home screen:

1. during start
2. inside your when\_shuffle\_click in the home screen.
3. the same can be placed inside the when\_allthoughts\_clicked , but without the set\_label statement - for you just want allthoughts screen to simply display what is the current thoughts list.

you can pack into a function that you can call in those 3 places.

---

<div class="post-metadata">

### Author: ![dragonsblazing19zem9](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dragonsblazing19zem9](https://community.thunkable.com/u/dragonsblazing19zem9)
#### Post date: [June 18, 2023, 3:54pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/12 "2023-06-18T15:54:59Z")

</div>

i didnt quite understand what you ment here …  
do you mind explaining this?

---

<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: [June 18, 2023, 4:08pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/13 "2023-06-18T16:08:46Z")

</div>

You are initializing `app variable list display` to an empty list on the “All thoughts” screen. But that screen comes _after_ the “Home screen” screen. So on the Home screen where you are trying to get an item from that list, that’s going to fail. Even if it did work, it would be an empty list.

What are you expecting the value of these blocks to be?

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

Because you’re taking a random item from an empty list…

As an example, please set `app variable list display` to an actual value **on the home screen**. Then test and see if you still get _undefined_.

---

<div class="post-metadata">

### Author: ![dragonsblazing19zem9](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dragonsblazing19zem9](https://community.thunkable.com/u/dragonsblazing19zem9)
#### Post date: [June 18, 2023, 6:27pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/14 "2023-06-18T18:27:31Z")

</div>

Thanks! it worked and now it doesn’t show undefined. 😀

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)
#### Post date: [September 16, 2023, 6:27pm UTC](https://community.thunkable.com/t/how-do-i-take-an-item-from-my-list-in-blocks-and-display-that-item-in-a-label-ive-created/2469924/15 "2023-09-16T18:27:35Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
