# Sorting Data viewer list

**URL:** <https://community.thunkable.com/t/sorting-data-viewer-list/1172988>\
**Category:** Questions about Thunkable X\
**Created:** [March 17, 2021, 7:14pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988 "2021-03-17T19:14:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [March 17, 2021, 7:14pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/1 "2021-03-17T19:14:13Z")

</div>

I was looking for a way to sort the data in Data viewer lists to display it sorted Ascending  
I used the following, to solve it.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/3/f39506a136b505391f9fc6d68575cb6644ac4bdd.jpeg)

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/e/6e19d485c4db168b8c590c59d537548ddc06d30b.jpeg)

is there any other way to sort the data…?

---

<div class="post-metadata">

**Author:** ![muneer](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/muneer/32/75210_2.png) [@muneer](https://community.thunkable.com/u/muneer)\
**Post date:** [March 17, 2021, 7:45pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/2 "2021-03-17T19:45:31Z")

</div>

This is a much quicker option.  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/2/62b9bd1809a52e997c4e8f4c313067f5785514fe.png)

Once you get the values in the list, sort the list using this block.

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [March 17, 2021, 8:33pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/3 "2021-03-17T20:33:54Z")

</div>

Thank you, Muneer…I used it in my coding…and to be honest, I got the idea from your post… 🙏 👏 👏

---

<div class="post-metadata">

**Author:** ![nmtabooks](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/nmtabooks/32/100232_2.png) [@nmtabooks](https://community.thunkable.com/u/nmtabooks)\
**Post date:** [March 17, 2021, 8:36pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/4 "2021-03-17T20:36:40Z")

</div>

![2021-03-18 00.34.53](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/6/6616c0c598e1f0a4611c3f1cfa7c960a0fd3530f.jpeg)

---

<div class="post-metadata">

**Author:** ![ksp](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@ksp](https://community.thunkable.com/u/ksp)\
**Post date:** [October 10, 2022, 4:48pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/5 "2022-10-10T16:48:08Z")

</div>

Hi,  
I have read the various topics about sorting. The content of my Data List Viewer is based on an Airtable.  
In my app, the users should be able to change the sorting themselves (alphabetical or price).  
How to solve this in the easiest way?  
Isn’t there an easier way than building these “parallel” lists?  
Thanks.

---

<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:** [October 10, 2022, 7:32pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/6 "2022-10-10T19:32:53Z")

</div>

when you use the airtable api and the api blocks, you can set your data to be sorted by a particular column. If you are using data blocks to get your data instead, you’ll need to manually code your your sorting logic.

---

<div class="post-metadata">

**Author:** ![ksp](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@ksp](https://community.thunkable.com/u/ksp)\
**Post date:** [October 10, 2022, 7:42pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/7 "2022-10-10T19:42:41Z")

</div>

Thanks, jared

I’m using the Airtable API, and the default sorting (A…Z) is based on a specific column. It works fine. But when the user press a specific button, the sorting must be changed to Z…A.  
How can it be done in the most simple way?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [October 10, 2022, 9:58pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/8 "2022-10-10T21:58:02Z")

</div>

I would probably just make another Airtable API call with the column as a sort key. You can do that with filterByFormula (which you can find on these forums or by Googling if you’re not familiar).

---

<div class="post-metadata">

**Author:** ![undefined5](https://avatars.discourse-cdn.com/v4/letter/u/54ee81/32.png) [@undefined5](https://community.thunkable.com/u/undefined5)\
**Post date:** [January 27, 2024, 6:29pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/9 "2024-01-27T18:29:19Z")

</div>

How to convert a Data viewer list to a list that then can be sorted with the code sample by muneer ?

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [January 27, 2024, 7:28pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/10 "2024-01-27T19:28:50Z")

</div>

To sort a Data Viewer List (DVL), sort the database itself. To get the DVL data as a list, use the `list of values` block. But if you sort that list in Thunkable, it won’t change the way the DVL is displayed. You still have to sort the original data. If you want a list that can be sorted and displayed in Thunkable, you’ll need to use a Simple List (aka List Viewer).

---

<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, 1:25pm UTC](https://community.thunkable.com/t/sorting-data-viewer-list/1172988/11 "2024-11-08T13:25:57Z")

</div>


