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

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”

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.

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

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.

please share a screenshots

Thanks, I DM you.

1 Like