How to set/access 2D list/array

I appreciate the explanation. Very clear! I actually did understand the concept but I wasn’t sure what you were initially asking. Looks like you figured out how to set the value of the two-dimensional array/list but you’re wondering how to reference items of a list inside a list.

Building off of what @muneer created, this will give you the value of Array[2][2]:

I’d probably create a function with inputs for the row & column to simplify the process and allow you to use it repeatedly:

And here’s yet another method, perhaps the simplest:

Note that when using the get property of object block, the sub-list/array index value starts at 0 unlike the in list get # block which starts at 1. So you’d need to use [2].1 to get the second value of 5.

In case you want to play around with these:

https://x.thunkable.com/copy/c1d27648ec0a62e062df28d6c0a68ca6

3 Likes