# Storing a button's text in a list

**URL:** https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152
**Category:** Questions about Thunkable X
**Tags:** lists, button
**Created:** [February 15, 2022, 6:14pm UTC](https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152 "2022-02-15T18:14:22Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![sklemmer233hj9x](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sklemmer233hj9x](https://community.thunkable.com/u/sklemmer233hj9x)
#### Post date: [February 15, 2022, 6:14pm UTC](https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152/1 "2022-02-15T18:14:22Z")

</div>

I am trying to make it so that when a button is clicked, all the other buttons’ texts get cleared, but it is not working. I think the issue has to do with how I am storing the text in a list. Here is some photos of my code. There also could be else that is causing the problem. How else would I go about this?

 ![Screen Shot 2022-02-15 at 11.14.06](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/0/907cb0b51329545b25ef97266675c5cd1181391d.png)

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [February 15, 2022, 8:24pm UTC](https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152/2 "2022-02-15T20:24:14Z")

</div>

Welcome to Thunkable.

You are filling the list with the text content of the buttons but in your loop you try to `set j to ""`.

This is setting the text from the list but not setting the button itself.

---

<div class="post-metadata">

### Author: ![sklemmer233hj9x](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sklemmer233hj9x](https://community.thunkable.com/u/sklemmer233hj9x)
#### Post date: [February 16, 2022, 5:33pm UTC](https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152/3 "2022-02-16T17:33:36Z")

</div>

So what would you suggest to reach the same goal? I have tried a few things but nothing seems to work out. Do I need to just manually set all the button’s text to " "?

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [February 16, 2022, 5:36pm UTC](https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152/4 "2022-02-16T17:36:04Z")

</div>

Can you explain what is that you want to achieve so I can explain the way to get it done.

---

<div class="post-metadata">

### Author: ![sklemmer233hj9x](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sklemmer233hj9x](https://community.thunkable.com/u/sklemmer233hj9x)
#### Post date: [February 16, 2022, 5:48pm UTC](https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152/5 "2022-02-16T17:48:45Z")

</div>

Thank you! I am trying to make it that when each button is clicked, the texts of all the other buttons are cleared and then only the button that was clicked’s text is set to “Selected.”

---

<div class="post-metadata">

### Author: ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)
#### Post date: [February 16, 2022, 6:03pm UTC](https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152/6 "2022-02-16T18:03:02Z")

</div>

Try this quick demo  
[https://x.thunkable.com/projectPage/620d361cfac83a00119472f8](https://x.thunkable.com/projectPage/620d361cfac83a00119472f8)

Hope that helps.

---

<div class="post-metadata">

### Author: ![sklemmer233hj9x](https://avatars.discourse-cdn.com/v4/letter/s/f17d59/32.png) [@sklemmer233hj9x](https://community.thunkable.com/u/sklemmer233hj9x)
#### Post date: [February 17, 2022, 9:24pm UTC](https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152/7 "2022-02-17T21:24:27Z")

</div>

Thank you so much! This helped a lot.

---

<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: [May 18, 2022, 9:24pm UTC](https://community.thunkable.com/t/storing-a-buttons-text-in-a-list/1736152/8 "2022-05-18T21:24:30Z")

</div>

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