# Creating text input "text" from checked checkbox items

**URL:** https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941
**Category:** Questions about Thunkable X
**Created:** [May 4, 2023, 9:16am UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941 "2023-05-04T09:16:35Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![isaline.duminilct](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/isaline.duminilct/32/152453_2.png) [@isaline.duminilct](https://community.thunkable.com/u/isaline.duminilct)
#### Post date: [May 4, 2023, 9:16am UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/1 "2023-05-04T09:16:35Z")

</div>

I am a total beginner . first time posting help, hoping this is the correct way to interact with this community 🙂

I would like to generate a text output that fills in a text input box from checked boxes.

I create a checkbox list, the user ticks items that they are interested in , those items after appear into a text input box.

Can you please tell me if this is doable and what the code would look like please.  
Thank you so much

---

<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: [May 4, 2023, 5:12pm UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/2 "2023-05-04T17:12:04Z")

</div>

Hi, welcome to Thunkable! Yes, you’re doing this right. 😉

What you’re describing is definitely possible and not too difficult. You can use the Join block in the Text drawer to combine multiple text strings into one. Assign that block to a variable and then assign the Text Input’s Text to that variable to display the combined text.

As for check boxes, you’ll need to code it so that when the check box is changed and the value is true, you’ll refresh the combined text.

The one tricky part is that you don’t want to join the existing text… you need to construct the full text from scratch each time they make a change to a checkbox. So the process would be to set the variable to an empty string (“”) and then add any parts based on the checkboxes.

That may sound confusing since you’re new to Thunkable. Give it a go and post a screenshot of blocks you’ve tried and someone can probably steer you to the next improvement.

---

<div class="post-metadata">

### Author: ![isaline.duminilct](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/isaline.duminilct/32/152453_2.png) [@isaline.duminilct](https://community.thunkable.com/u/isaline.duminilct)
#### Post date: [May 5, 2023, 3:28pm UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/3 "2023-05-05T15:28:04Z")

</div>

Hi, so this is what I have done . it does put the text of the checkbox in the text input 2 location but one after the other and not adding them. i’d like to be able to select breakfast, lunch and dinner and see the 3 words in text input 2 and not only one after the other. I have instructed the part one the right first and then created the group like you suggested but I am not sure this is how you meant it.  
Bottom part call to ChatGPT was not able to try yet, I have to get more credits.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/1/b11b8f90467e5eb96ea021c0bc100e3c0964bd5a.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: [May 5, 2023, 3:42pm UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/4 "2023-05-05T15:42:42Z")

</div>

Posting a screenshot of your blocks is really helpful but we need to back up a moment because I still don’t fully understand how you want it to work.

Can you provide a sketch or example of the choices the user might have and what a correct result would look like? And does the user need to click a Submit button or anything like that?

---

<div class="post-metadata">

### Author: ![isaline.duminilct](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/isaline.duminilct/32/152453_2.png) [@isaline.duminilct](https://community.thunkable.com/u/isaline.duminilct)
#### Post date: [May 6, 2023, 9:33am UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/6 "2023-05-06T09:33:39Z")

</div>

![PXL_20230506_093205810](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/0/c04250d13e092b4fb58f1075a52b7c22f45b0804.jpeg)

Does this help clarify ?

1. user selects the criterias from checkbox
2. selection appears in the text input 2 box - there can be mutliple items selected they appear ideally separate by a , comma.
3. user presses the request button
4. request is sent to open ai with a special prompt prior to the list from text input 2 .

again thank you so much for your kind help

---

<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: [May 6, 2023, 4:23pm UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/7 "2023-05-06T16:23:04Z")

</div>

Yes, that’s very helpful.

I’m just going to repost the image rotated and a little brighter (if it’s too big, I’ll re-size it later; I’m on my phone):

 ![Image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/7/175e2650a4f44bdf641c1d9302ca859aa1b2c817.jpeg)

The algorithm I would use is:

1. When checkbox value changes

- If value is true, add the associated value to a list
- If value is false, find that value in the list and delete that item from the list.

1. Convert the list to comma-separated text (there’s a block for that) and set a label’s text to that value to display it.

I can post an example of blocks later if that’s helpful.

---

<div class="post-metadata">

### Author: ![isaline.duminilct](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/isaline.duminilct/32/152453_2.png) [@isaline.duminilct](https://community.thunkable.com/u/isaline.duminilct)
#### Post date: [May 6, 2023, 4:58pm UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/8 "2023-05-06T16:58:17Z")

</div>

That would be great because I am not being successful 😑

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/c/6c82b300af823d4408d1d4bfc6eeb93432801f7c.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: [May 6, 2023, 5:28pm UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/9 "2023-05-06T17:28:18Z")

</div>

You’re close! It’s so helpful when people post screenshots of their blocks. Would you be able to share the project link with me? It’s faster if I modify your blocks than try to create them all myself.

Your [if][true] condition will **always** be true because it’s just checking to see if true is true. It is! You need to check if [newValue]. Because that green block will either be true or false depending on the state of the checkbox.

When you insert an item in the list, do not also convert to comma-separated. That needs to happen for the label, not for the list.

When you remove an item, it’s complicated… you need to search for the value _associated_ with that checkbox (the Text Input’s Text) and then remove the item # that was found. Again, if I have your project link, I can provide an example.

---

<div class="post-metadata">

### Author: ![isaline.duminilct](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/isaline.duminilct/32/152453_2.png) [@isaline.duminilct](https://community.thunkable.com/u/isaline.duminilct)
#### Post date: [May 10, 2023, 4:00pm UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/10 "2023-05-10T16:00:32Z")

</div>

Hi, I am so sorry for my radio silence. here is the link to the project [Thunkable](https://x.thunkable.com/copy/73c7d7230eb29cf83e26e1a0a49a9cca) . I am looking forward to understand how you text translates into those blocks 🙂 thank you for your help

---

<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: [May 10, 2023, 4:40pm UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/11 "2023-05-10T16:40:43Z")

</div>

> [@isaline.duminilct](#):
>
> Thunkable

I’ll modify it and share the new link with you.

One main problem is that you’re using the green `newValue` block repeatedly as the value of the checked item’s text. So if I have this:

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/9/99bd0ce148835cad8db0703dd5ea379663dd7647.jpeg)

Then newValue for checkbox1 is true (checked) while newValue for checkbox4 is false (unchecked). The newValue block doesn’t have any connection to the label’s text value such as “item 1” or “item 4”. It can only contain true or false which is why this doesn’t really do anything:

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/optimized/3X/f/9/f96908c4c1f3ca84e56129ff29dca472322d9077_2_552x44.png)

It’s just telling Thunkable to add “true” or “false” to the end of the list.

---

<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: [May 10, 2023, 4:55pm UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/12 "2023-05-10T16:55:20Z")

</div>

Here’s the modified project: [Thunkable](https://x.thunkable.com/copy/9022d1f54abe15f9c916619d2c546181)

I created blocks for the first two checkbox items. You can duplicate those for the remaining items. Just change the list item # after each `get #` in each case (1, 2, 3, etc.).

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

---

<div class="post-metadata">

### Author: ![isaline.duminilct](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/isaline.duminilct/32/152453_2.png) [@isaline.duminilct](https://community.thunkable.com/u/isaline.duminilct)
#### Post date: [May 15, 2023, 6:44am UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/13 "2023-05-15T06:44:55Z")

</div>

thank you so much. this is incredibly helpful!

---

<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: [August 13, 2023, 6:45am UTC](https://community.thunkable.com/t/creating-text-input-text-from-checked-checkbox-items/2402941/14 "2023-08-13T06:45:27Z")

</div>

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