# Sort option in repeater

**URL:** <https://forum.wixstudio.com/t/sort-option-in-repeater/52451>\
**Category:** Ask the community\
**Tags:** code, question, cms\
**Created:** [September 17, 2023, 3:52am UTC](https://forum.wixstudio.com/t/sort-option-in-repeater/52451 "2023-09-17T03:52:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlazzzarus](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mlazzzarus](https://forum.wixstudio.com/u/mlazzzarus)\
**Post date:** [September 17, 2023, 3:52am UTC](https://forum.wixstudio.com/t/sort-option-in-repeater/52451/1 "2023-09-17T03:52:32Z")

</div>

Hello,  
I have a repeater with images linked to a dataset. I am able to do a filter option to display only certain items. But I would like to separately sort them and display them according to the sort criteria for certain connected data. I cannot seem to find any option to do this.  
Is this solvable only using code or is there some option somewhere to enable this?  
Any help would be appreciated, thanks.

---

<div class="post-metadata">

**Author:** ![JessCK](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/jessck/32/81287_2.png) [@JessCK](https://forum.wixstudio.com/u/JessCK)\
**Post date:** [September 21, 2023, 11:13pm UTC](https://forum.wixstudio.com/t/sort-option-in-repeater/52451/2 "2023-09-21T23:13:03Z")

</div>

HI! Are you trying to sort this before it is shown in the repeater, or are you trying to add a sort option to the live page that then sorts the repeater based on the chosen criteria?

If you’re trying to sort the data ahead of time to only show certain data in a repeater, you can do so by adding a sort (or even a filter) within the connected dataset settings. To do so, connect a dataset to your repeater, then click “settings” then “add sort”:

 ![image](https://us1.discourse-cdn.com/wix/original/3X/7/1/710732037038df13aecfc44f972ebd26be3786c4.png)

Otherwise you can achieve the same functionality using a wixData sort with Velo:

> **[sort - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-data/sort)**
>
> Creates a sort to be used with the dataset setSort() function. This function is not used on its own. It is only used to create a sort for a dataset using the ...

Here’s a more detailed explanation from wix support docs:

> **[CMS (Formerly Content Manager): About Filtering and Sorting Collection Items...](https://support.wix.com/en/article/cms-formerly-content-manager-about-filtering-and-sorting-collection-items-on-your-site)**
>
> When a dataset is connected to a collection, it has access to all of that collection's fields and items. To control which items appear in the dataset's connecte

---

<div class="post-metadata">

**Author:** ![mlazzzarus](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mlazzzarus](https://forum.wixstudio.com/u/mlazzzarus)\
**Post date:** [September 22, 2023, 4:55am UTC](https://forum.wixstudio.com/t/sort-option-in-repeater/52451/3 "2023-09-22T04:55:59Z")

</div>

Thanks I am trying to sort after displaying the data to give the user the option to view the data in the manner they prefer. I have implemented a filter using the input dropdown element but there is nothing pre-formatted like that for a sort.  
I shall try the options you have suggested. Thank you!

---

<div class="post-metadata">

**Author:** ![JessCK](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/jessck/32/81287_2.png) [@JessCK](https://forum.wixstudio.com/u/JessCK)\
**Post date:** [September 22, 2023, 8:18pm UTC](https://forum.wixstudio.com/t/sort-option-in-repeater/52451/4 "2023-09-22T20:18:30Z")

</div>

Gotcha! I’m not currently using a custom sort feature on my sites, BUT I did come across this awesome example from @anon72313111 on Wix Velo examples: [https://www.wix.com/velo/example/multiple-filter-methods](https://www.wix.com/velo/example/multiple-filter-methods)

His ‘queryAndsort.jsw’ code might be helpful as inspiration for what you need 🙂

---

<div class="post-metadata">

**Author:** ![mlazzzarus](https://avatars.discourse-cdn.com/v4/letter/m/43a26b/32.png) [@mlazzzarus](https://forum.wixstudio.com/u/mlazzzarus)\
**Post date:** [September 23, 2023, 2:05am UTC](https://forum.wixstudio.com/t/sort-option-in-repeater/52451/5 "2023-09-23T02:05:07Z")

</div>

Looks like just what I am looking for. I don’t have much experience in coding so it will take a while for me to figure out and adapt but I look forward to doing so 🙂 Thank you, much appreciated!

---

<div class="post-metadata">

**Author:** ![JessCK](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/jessck/32/81287_2.png) [@JessCK](https://forum.wixstudio.com/u/JessCK)\
**Post date:** [September 27, 2023, 7:10pm UTC](https://forum.wixstudio.com/t/sort-option-in-repeater/52451/6 "2023-09-27T19:10:01Z")

</div>

No problem! And if you’re just getting started with coding on Wix, there’s a great free course on Codecademy called [Create a Professional Website with Velo by Wix | Codecademy](https://www.codecademy.com/learn/create-a-professional-website-with-velo-by-wix). I actually used that to start my coding experience. That might be enough to get you going with the sorting functionality you need, but if you’d like to dive-in further, you’ll probably want to take a full JavaScript course like Codecademy’s free course: [Learn JavaScript | Codecademy](https://www.codecademy.com/learn/introduction-to-javascript) (I also took that one and that provided the basis I needed to create some cool stuff on Wix/EditorX).

Best of luck! 🙂
