# Sorted/Ordered list problem

**URL:** https://community.thunkable.com/t/sorted-ordered-list-problem/564705
**Category:** Questions about Thunkable X
**Created:** [May 4, 2020, 2:24am UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705 "2020-05-04T02:24:40Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![hovis70653qy](https://avatars.discourse-cdn.com/v4/letter/h/a183cd/32.png) [@hovis70653qy](https://community.thunkable.com/u/hovis70653qy)
#### Post date: [May 4, 2020, 2:24am UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/1 "2020-05-04T02:24:40Z")

</div>

Hi Thunkers,

I have a list of 20 variables. I removed variables which are value zero and then ordered the list so that the highest valued variable goes to the top (index 1) and the lowest to the bottom (#).

I have tested this by displaying variable values in labels, and that works fine. My problem is that I not only want the variables’ values but also their variable names. After the sorting/ordering/removing this seems hard to keep track of for me. It is for quiz feedback. I want user to see their most commonly made mistake at the top of the list in an image and then inform the user of the number of times the mistake was made.

So, from a sorted list, can I read off both the number value of the variable at the top/second/third etc and also the name of the variable so that the appropriate “mistake” picture can be displayed?

Is it possible with blocks to query the list: from listA get varName and get varValue? (I accept this question may strike you as bonkers but I can’t get my head round how I’m going wrong).

Thank you for reading.

---

<div class="post-metadata">

### Author: ![hovis70653qy](https://avatars.discourse-cdn.com/v4/letter/h/a183cd/32.png) [@hovis70653qy](https://community.thunkable.com/u/hovis70653qy)
#### Post date: [May 4, 2020, 4:44am UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/2 "2020-05-04T04:44:26Z")

</div>

Does this question mean I am trying to access the variables’ meta data and it is not available without complex coding? Please let me know if you think I’m going about this entirely wrongly and should, for example, use a DB or local storage…etc.

---

<div class="post-metadata">

### Author: ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)
#### Post date: [May 4, 2020, 7:10am UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/3 "2020-05-04T07:10:19Z")

</div>

suppose you have 3 variables and values: A=23 B=14 C=2, you want to build a list containing [1023A, 1014B,1002C] using math and join. sort the list into [1002C, 1014B, 1023A], split each one at the 5 position (ie. split into number and variable name) then subtract 1000 from the number. now you can build your “goal picture”

---

<div class="post-metadata">

### Author: ![hovis70653qy](https://avatars.discourse-cdn.com/v4/letter/h/a183cd/32.png) [@hovis70653qy](https://community.thunkable.com/u/hovis70653qy)
#### Post date: [May 4, 2020, 12:03pm UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/4 "2020-05-04T12:03:41Z")

</div>

Thanks Many…it sounds too tricky for me. I’m just starting.

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [May 4, 2020, 12:55pm UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/5 "2020-05-04T12:55:00Z")

</div>

You probably want to learn about storing objects in lists. What you are asking about is at least an intermediate skill I would think.

You could also organize the info in tables.

Columns could be like:

Question, answer, times seen, times answered correct, times answered incorrect.

---

<div class="post-metadata">

### Author: ![hovis70653qy](https://avatars.discourse-cdn.com/v4/letter/h/a183cd/32.png) [@hovis70653qy](https://community.thunkable.com/u/hovis70653qy)
#### Post date: [May 4, 2020, 1:04pm UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/6 "2020-05-04T13:04:28Z")

</div>

Thanks, Jared.  
Can you point me to a good beginner level tutorial on storing in lists?

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [May 4, 2020, 1:25pm UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/7 "2020-05-04T13:25:00Z")

</div>

Hi @hovis70653qy,

You could check this out  
[![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/0/2065d9c013908ef645eb64d05838ee2dc9fd3201.jpeg)](http://jaredgibb.xyz/thunkable/sample-apps/)

You’ll also find an airtable example there for working eith tables

I think if you store your variables as a list of objects  
It could look like this  
[  
{  
Question: “What’s your name?”,  
Answer: “Jared”,  
timesSeen: 10,  
timesAnsweredIncorrectly: 5  
},  
{  
Question: “What’s your age?”,  
Answer: 32,  
timesSeen: 10,  
timesAnsweredIncorrectly: 10  
}  
]

---

<div class="post-metadata">

### Author: ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)
#### Post date: [May 4, 2020, 4:27pm UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/8 "2020-05-04T16:27:53Z")

</div>

i happen to have a simple, generic, quiz maker based on airtable, which i was going to share in the share\_your\_apps forum but haven’t gotten all the parts together yet. if you have an android, you can download the apk (executable) from here

> **[quiz maker.apk](https://www.dropbox.com/s/a7q07shpn1c2ykk/quiz%20maker.apk?dl=0)**
>
> Shared with Dropbox

and see if it is useful for you.  
the data is based on this simple table:

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

the field **group** is an arbitrary classification that can be used for designating a chapter, difficulty level, user, etc. and is used for selecting the kind of test at the start. the field **answer1** always contains the correct answer but the app will randomize the order during execution, but it will keep score, for the session.  
(edited)  
i’ve added my app in the share your app forum. please check if you can use it.

---

<div class="post-metadata">

### Author: ![darren](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/darren/32/69854_2.png) [@darren](https://community.thunkable.com/u/darren)
#### Post date: [July 14, 2020, 1:58pm UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/9 "2020-07-14T13:58:53Z")

</div>

> [@jared](#):
>
> You probably want to learn about storing objects in lists.

> [@hovis70653qy](#):
>
> Can you point me to a good beginner level tutorial on storing in lists?

Refer to this post:

> [@Coding Challenge! ~ Sort a List of Objects](http://community.thunkable.com/t/coding-challenge-sort-a-list-of-objects/617337/3):
>
> Update: This video shows you how to add my sorting algorithm above to your app! [[Coding Challenge! How to Sort a List of Objects in Thunkable] ](https://www.youtube.com/watch?v=vLiseLOTlKU)

---

<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, 11:29am UTC](https://community.thunkable.com/t/sorted-ordered-list-problem/564705/10 "2024-11-08T11:29:30Z")

</div>


