# Remove variable text from another variables text

**URL:** <https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098>\
**Category:** Questions about Thunkable X\
**Created:** [October 12, 2021, 1:57pm UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098 "2021-10-12T13:57:31Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![bikeon.kfte5](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@bikeon.kfte5](https://community.thunkable.com/u/bikeon.kfte5)\
**Post date:** [October 12, 2021, 1:57pm UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098/1 "2021-10-12T13:57:31Z")

</div>

Hi

@tatiang @muneer

I want to remove items one at a time from a list variable (BikeON 0020,BikeON 0019,BikeON 0018) The list variable is retrieved from airtable, the individual item is also from the same table but is also currently the same as the scan value (using airtable as i possibly want to change this in future)

 ![Screen Shot 2021-10-12 at 3.53.42 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/3/f396a0dc496b1d32405e9520470b867c6e5f12af.png)

When items are rented out a list is created of every item that was rented with the same contract. When they are returned they are scanned and a list of every associated item is displayed, i wand to remove each item from this list as it is scanned as returned. There are items like helmets that may or may not be rented out with the bikes so need to track each item carefully

 ![IMG_F65FF5C41ECE-1](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/d/6d7369b45b8d3eafc05df92904b352b0f53a0233.jpeg)

---

<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:** [October 12, 2021, 2:45pm UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098/2 "2021-10-12T14:45:12Z")

</div>

> [@bikeon.kfte5](#):
>
> When they are returned they are scanned and a list of every associated item is displayed, I want to remove each item from this list as it is scanned as returned.

You can use the `get and remove` list block from the List drawer to do this after each scan. You’ll have to find the scanned item (most likely using the `find first occurrence of` block to get its index number) and then remove it that way.

---

<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:** [October 12, 2021, 3:12pm UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098/3 "2021-10-12T15:12:16Z")

</div>

> [@bikeon.kfte5](#):
>
> BikeON 0020,BikeON 0019,BikeON 0018

This seems to be a list in a text format. Use the block `make list from text` in the `Lists drawer` to convert it to a list so you can perform the suggestion given by @tatiang

---

<div class="post-metadata">

**Author:** ![bikeon.kfte5](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@bikeon.kfte5](https://community.thunkable.com/u/bikeon.kfte5)\
**Post date:** [October 12, 2021, 7:05pm UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098/4 "2021-10-12T19:05:25Z")

</div>

I thought it was something like this but because the blocks mentioned have to be plugged into another block I couldn’t figure how to make them work. I tried the following and it didn’t work, not that i really expected it to… Which block am I missing?

 ![Screen Shot 2021-10-12 at 9.00.11 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/e/9e0a63797757cd37ddcede15f367df96db8a4c89.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:** [October 12, 2021, 7:31pm UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098/5 "2021-10-12T19:31:10Z")

</div>

The top set of blocks should return an integer. Assign that to a label (`set label's text to`) instead of a variable and then let us know what number appears.

The bottom set of blocks should return a list item. Assign that to a label as well and see if it’s what you expect the value to be. Also, ideally, you’d want to remove the item # matching the result of the top set of blocks. So if the top set returns 5, then you would `get and remove` the 5th item, not necessarily the first item as you have it set to. You can do this manually, putting in the number 5 (or whatever the top blocks return), to test it and then later replace it with a variable.

If you don’t already do this, it’s really important to debug your blocks using labels so that you can see each intermediate step. I find that also helps me piece together (pun intended!) what is happening as I read through my code.

---

<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:** [October 12, 2021, 7:42pm UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098/6 "2021-10-12T19:42:19Z")

</div>

I made an example of a list from January to June and I want to remove April from it. See the code

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

This is the start screen  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/e/8/e801eec5ab134028259233083a9abca9060f8e8a.png)

This is after clicking the button  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/a/1a0b7c674e1735a5012155316215926cbd42d267.png)

April gone from the list

This is if you click the button a second time  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/2/7201f27d058166bd299ab5ad078ebb0bad24a1c4.png)

---

<div class="post-metadata">

**Author:** ![bikeon.kfte5](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@bikeon.kfte5](https://community.thunkable.com/u/bikeon.kfte5)\
**Post date:** [October 13, 2021, 10:15am UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098/7 "2021-10-13T10:15:09Z")

</div>

Hi

the List from text block is crashing my app, any idea what I have done wrong? It display the variable as is but not when converted.

 ![Screen Shot 2021-10-13 at 12.09.55 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/9/f9738474f45ec56d0bcbad9fabc9efe578f5cdff.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:** [October 13, 2021, 11:32am UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098/8 "2021-10-13T11:32:30Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/4/3/43f3990a1cd3fc21ed5850f4443fd2200c147640.png)  
This is your problem.

---

<div class="post-metadata">

**Author:** ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)\
**Post date:** [November 8, 2024, 1:14pm UTC](https://community.thunkable.com/t/remove-variable-text-from-another-variables-text/1558098/9 "2024-11-08T13:14:52Z")

</div>


