CMS Development

Suonpera
Member

Loop hubdb table rows in reverse order

SOLVE

Hey Friends,

 

Currently using this to loop through a table
{% for row in hubdb_table_rows('2594592', 'GET') %}

 

But I need it in the reverse order, so I can display the most recent rows first. 

How do I do that?

Couldn't find any similar examples in the documentation.

 

Thanks!

 

0 Upvotes
1 Accepted solution
prosa
Solution
Top Contributor

Loop hubdb table rows in reverse order

SOLVE
{% for row in hubdb_table_rows('2594592', '&orderBy=-hs_created_at') %}

Notice the '-' symbol

If this post helped you resolve your issue, please consider marking it as the solution. Thank you for supporting our HubSpot community.

View solution in original post

1 Reply 1
prosa
Solution
Top Contributor

Loop hubdb table rows in reverse order

SOLVE
{% for row in hubdb_table_rows('2594592', '&orderBy=-hs_created_at') %}

Notice the '-' symbol

If this post helped you resolve your issue, please consider marking it as the solution. Thank you for supporting our HubSpot community.