How to create a list in a list?
I want to create a list of lists. I want every line as a list with 6 items and the whole thing as a list with 4 items. Technically the format you get when you multiply two large numbers.
Big List{
{450845} ==> List1
{245455} ==> List2
{534547} ==> List3
{676767} ==> List4
When I type in a number and click button it should insert it in List1 and once it reaches 6 items go to List2 so on and so forth. So it is one number at a time. Basically if we had “in list” “list” feature for the “in list” … “insert at” then it might have worked. Like “in list” “list”… “insert at”

I would encourage you to simplify this a little. Instead of thinking of it as a list inside a list (which it can be), use text strings to hold the digits for each six-digit number. When the user clicks a number button, join the variable with the value to be added. For example, if they click “3”, join [app variable List1] with “3”. Then if they click “5” join [app variable List1] with “5”. If you make the button’s text the value associated with it, you can even make the coding really efficient by just joining [app variable List1] with [button’s text]. This does require the Any Component blocks which are a little more advanced but you can save a ton of blocks that way.

Then, if you want, you can make a list of those text strings [app variable List1], [app variable List2], etc. I’m not sure why you need a list of them but if it’s necessary then it shouldn’t be hard to do that. By the way, you don’t need to use an index variable for your list. You can just use the [in list insert at last as] block shown here: Lists - Thunkable Docs. That will add the value to the end of the list as a new item.

On a related note, if you want to convert a string to a number, add zero to it (so “3” + 0 becomes 3). And if you want to convert a number to a string, join it with an empty string (so join [3] with “” becomes “3”).

Are you making a calculator?

1 Like

Sorry for the long delay. I was on vacation and had to do lot of work to get the whole thing working. Finally the things in good shape. List in a list worked. Yes I am working something like a calculator. The output looks something like this. Not finalized:

The product lines are all part of a list view and the content itself were lists originally. Manipulating index by index of a list is easy. Thank you again for coming to my aid.

1 Like

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