# How to order datas "ASC" or "DESC" from collection connected to Xano

**URL:** <https://community.weweb.io/t/how-to-order-datas-asc-or-desc-from-collection-connected-to-xano/10663>\
**Category:** How do I?\
**Created:** [September 5, 2024, 1:14pm UTC](https://community.weweb.io/t/how-to-order-datas-asc-or-desc-from-collection-connected-to-xano/10663 "2024-09-05T13:14:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![7homa5](https://avatars.discourse-cdn.com/v4/letter/7/90db22/32.png) [@7homa5](https://community.weweb.io/u/7homa5)\
**Post date:** [September 5, 2024, 1:14pm UTC](https://community.weweb.io/t/how-to-order-datas-asc-or-desc-from-collection-connected-to-xano/10663/1 "2024-09-05T13:14:09Z")

</div>

Hello there,

I am junior developer and I am starting to use WeWeb with a Xano database. I have created a collection (Parcel Tracking) which get the datas from Xano.

I put in “sort\_by” formula : “created\_at” and in “order\_by” formula : “DESC”

After that I have added a “DataGrid” on my page which display all the datas.

Then I decided to add 2 buttons, one for display by dates “ASC” and another for display by dates “DESC”

 ![buttons](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/f/fcf30b6ee72f2a222dcf7b21981c97e75b336ba2.png)

By default, all datas are displayed from latest date to oldest. I want to change the order by clicking on the 2 buttons : one for displayed from oldest to latest and the other one to display from latest date to oldest.

My problem is that I am totally lost, I tried to make a worflow in order to apply the changes but it doesn’t work. I have no idea of what I can do.

So if somebody can help me, I will be grateful.

ps: I am not allowed to send many pics beacause I am new, so I sent just one.

---

<div class="post-metadata">

**Author:** ![aasiffreelancer](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@aasiffreelancer](https://community.weweb.io/u/aasiffreelancer)\
**Post date:** [September 5, 2024, 2:21pm UTC](https://community.weweb.io/t/how-to-order-datas-asc-or-desc-from-collection-connected-to-xano/10663/2 "2024-09-05T14:21:44Z")

</div>

Hi,

You can pass a dynamic value in xano API and get data data based on input like sortBy or orderBy  
In weweb you can add a workflow on the button to set a variable value call a xano API and pass the set variable value in API.  
I think it work let me know if you have any other question  
you can dm me we can disscuse your issue  
thanks

---

<div class="post-metadata">

**Author:** ![7homa5](https://avatars.discourse-cdn.com/v4/letter/7/90db22/32.png) [@7homa5](https://community.weweb.io/u/7homa5)\
**Post date:** [September 5, 2024, 2:27pm UTC](https://community.weweb.io/t/how-to-order-datas-asc-or-desc-from-collection-connected-to-xano/10663/3 "2024-09-05T14:27:08Z")

</div>

Hi and thanks for your answer, I tried to do this but I am totallly lost. I have made screenshots, I can send it to you if you are ok, maybe it will be more explicit.

---

<div class="post-metadata">

**Author:** ![aasiffreelancer](https://avatars.discourse-cdn.com/v4/letter/a/b38774/32.png) [@aasiffreelancer](https://community.weweb.io/u/aasiffreelancer)\
**Post date:** [September 5, 2024, 2:28pm UTC](https://community.weweb.io/t/how-to-order-datas-asc-or-desc-from-collection-connected-to-xano/10663/4 "2024-09-05T14:28:24Z")

</div>

please share a screenshots

---

<div class="post-metadata">

**Author:** ![7homa5](https://avatars.discourse-cdn.com/v4/letter/7/90db22/32.png) [@7homa5](https://community.weweb.io/u/7homa5)\
**Post date:** [September 5, 2024, 2:29pm UTC](https://community.weweb.io/t/how-to-order-datas-asc-or-desc-from-collection-connected-to-xano/10663/5 "2024-09-05T14:29:37Z")

</div>

Thanks, I DM you.
