Is this function available in Thunkable X?

Is this function from Thunkable Classic available in Thunkable X?
Capture
I did a search for this but I can’t find it in Thunkable X.

It’s not the same. In classic, that returns the index of the item in the list. Yours just returns if an item is in the list, not the index.

1 Like

There is no such block, really. But it’s easy to get it yourself.

1 Like

STILL NOT THE SAME!
For example:

If you have a list containing 2 elements, named MyList: a and b, and you do this:
index in list thing a
list MyList

It will result 1, because a is the first list item.
If you do the same with b, will result 2.

1 Like

Oh so you deleted the pic… So yeah, this is the answer.

%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5

2 Likes

@actech I tried your blocks but with your method my app get crashed and I don’t even know if it works because the app closes instantly.
What I really want is,
I set text to speech to pick the random item from “PlaceNames” list and speak and there’s a button “Why” When a user press that button “Text to Speech” will pick an item from “PlaceReply” list. But You know that I can’t pick it randomly I want to show exact item for each name.

How to get index number of an item?
So finally I did it with the following method


I add another variable “PlaceNames2” When random item from “PlaceNames” is picked, it text sets to “PlaceNames2”.
Hope it will help more newbies to.

2 Likes

Your solution is interesting, but it does not check for existence of list element. If the item is not in the list, the unit “find in list” will return 0, and the block “in list get” will return undefined, and Speak nothing plays that will confuse the user.

1 Like

Yes but actually (in this case) there is no way for the item to be not found in the list because “random item from list” will pick the item that exists in the list.
So for this situation it should work perfectly, maybe this will not work everywhere.
BTW Sorry for my English