Filtering & sorting query dynamically
Options
![Thomas Bonfils](https://us.v-cdn.net/6037124/user_avatars/5006242.jpg)
Thomas Bonfils
Member ✭
Hi Guys,
I would like to let my user filtering my query by firstname, lastname and choose which sorting (descending or ascending)
I need to chain condition but i don't know how to do it
If filter = firstname & sort = descending
Then query with firstname descending
Else query with firstname ascending
OR
if filter = lastname & sort = descending
Then query with lastname descending
Else query with lastname ascending
Etc etc..
Thanks for your help
Thomas
I would like to let my user filtering my query by firstname, lastname and choose which sorting (descending or ascending)
I need to chain condition but i don't know how to do it
If filter = firstname & sort = descending
Then query with firstname descending
Else query with firstname ascending
OR
if filter = lastname & sort = descending
Then query with lastname descending
Else query with lastname ascending
Etc etc..
Thanks for your help
Thomas
Comments
-
You can handle this in your frontend and pass the configuration to xano.
https://docs.xano.com/working-with-data/functions/database-requests/query-all-records/external-query-manipulation/external-filtering
It is also possible to do this logic in xano but may be easier in your frontend depending on the controls you allow in your UI. Definitely give this a try.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback