Removing element in a list without index

Hi,

I would like to delete a value within a list if the user clicks on a component. However, I only find the block which allows for deletion based on index, not value. Is there a way to delete a value within a list based on searching for a string?

E.g. within the list “Interests”, there are “Sports”, “Music”, “Reading”. I do not know at which index those elements will be located. Hence, I need to search based on the string, not index.

Please let me know if you have any suggestions.

Thanks,
Lukas

What if you had non-unique values in the list, would it delete all “Sports” or just the first occurrence of “Sports” that it finds?

There’s are also #thunkable-tutorials about making a Search Bar in your app that you might find useful:

All the values are unique, but what I am asking is how do I remove the unique value if I do not know the index? The # implies that I know the index of the value I want to delete, right? The issue is that I do not know the index, but rather just the value.

Screenshot 2021-01-06 at 15.28.09

You could use the “find first occurrence in list” block @lukas_b_98knm

1 Like