CMS Development

imerial
Participante

Sorting Tables

resolver

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 Me gusta
1 Soluciones aceptada
alyssamwilie
Solución
Experto reconocido | Partner nivel Elite
Experto reconocido | Partner nivel Elite

Sorting Tables

resolver

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.

Ver la solución en mensaje original publicado

0 Me gusta
1 Respuesta 1
alyssamwilie
Solución
Experto reconocido | Partner nivel Elite
Experto reconocido | Partner nivel Elite

Sorting Tables

resolver

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 Me gusta