CMS Development

imerial
Participant

Sorting Tables

SOLVE

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?') %}

table.png

0 Upvotes
1 Accepted solution
alyssamwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Sorting Tables

SOLVE

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') %}

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

View solution in original post

0 Upvotes
1 Reply 1
alyssamwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Sorting Tables

SOLVE

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') %}

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
0 Upvotes