- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Sorting Tables
SOLVEFeb 28, 2020 4:40 AM
Hi Community,
I have a table and I would like to sort it from the highers price to the lowest.
I know I have to use orderBy= in my query, but I'm not sure exactly how it works.
Can anyone help?
Thank you
{% set table = hubdb_table_rows(table_id,'assetclass__contains=Future',orderBy='what_goes_here?') %}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Accepted Solutions
Feb 28, 2020 2:30 PM - edited Feb 28, 2020 2:52 PM
You would put in the internal name of the column you want to sort by. I beliiieve if you want to go Highest to Lowest it'd be a reverse sort, so add a minus sign in front of the column name. Also, when you have multiple filters in your table function you want to use &, not commas.
{% set table = hubdb_table_rows(table_id,'&assetclass__contains=Future&orderBy=-price') %}

Alyssa Wilie
Web Developer at LyntonWeb
If this answer solved your question, please mark it as the solution!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content