HubDB rearrange order

Hi

We gathered our team members in a HubDB and have them displayed on our website. We would like to rearrange the order, e.g. make it alphabetical or change it from time to time. 

 

Is there a possibility? 

Thanks, Rahel

13 Replies
Top Contributor

This would be awesome!

Regular Contributor | Platinum Partner
Regular Contributor | Platinum Partner

Hi,

you can do it with thi syntax:

{% set queryparam = "&orderBy=-name_of_your_column_where_is_the_name_of_team_member" %}

note that after = there is a - (minus) character and this is to display the team in descending order (from Z -to A) but if you want the order with ascending order then delete le - (minus) character

 

Giovanni Zuanon

Occasional Contributor

I agree this functunality seems crucial! @giozua I tried your suggestion but it doesn't seem to be working.

Regular Contributor | Platinum Partner
Regular Contributor | Platinum Partner

This is an example that I've do 

http://www.think-inbound.com/calendario-eventi

and this is the initial query param of this example

{% set queryparam = "&orderBy=-data_evento" %}

In this case the data_evento is a date type field and the events are ordered by data_evento in descending order

 

Occasional Contributor

Thanks @giozua looks like it works with dates no problem! I am trying to get the composers here on this page http://cts-cph-1.hs-sites.com/all-composers-composer-cph-music to show up alphabetically by last name. I have a column in the database that just has their last names in there named "composer_last_name" so I have put  {% set queryparam = "&orderBy=composer_last_name" %} but I am wondering if this just isn't possible for text yet.

Occasional Contributor

@giozua, @Rahel, @arinker,

 

I found a solution by using this documentation https://designers.hubspot.com/docs/hubl/hubl-supported-filters under 'sort'!

 

123456 = your table number

composer_last_name = the column by which you want to sort with

 

{% set table = hubdb_table_rows(123456, queryparam)%}
{% set queryparam = hubdb_table_rows(123456, queryparam) %}

<div class="dynamic-info  row-fluid">{% if dynamic_page_hubdb_row %}        
  <span class="span5"><img src="{{ dynamic_page_hubdb_row.composer_image_url }}" /></span>
              <span class="span7">
           {{ dynamic_page_hubdb_row.composer_bio }} </span>
            <div class="clear-both"></div>
{% elif dynamic_page_hubdb_table_id %}
           <ul>
            {% for row in hubdb_table_rows(dynamic_page_hubdb_table_id)|sort(False, False, 'composer_last_name') %}
                <li><a href="{{ request.path }}/{{ row.hs_path }}">{{ row.hs_name }}</a></li>                
            {% endfor %}
           </ul>
{% endif %}
</div>

Regular Contributor

I still think it would be more user friendly to be able to edit a Hub DB from the admin side and drag rows around to the correct order I want. I think Hubspot strives to allow users to manipulate their websites without the need for advanced coding. This is a place where this could be improved.

Regular Contributor

@Crystal_Hopper we've been using hubDB for some time now and I (and my web developer) could swear that this was possible at one point in time. I've reached out to HS support, but they find no record of it. We really need this drag & drop sorting solution, so that we don't need a developer to help with a simple sort that isn't e.g. alphatbetical or using some other value. 

Regular Contributor

@Qt I would have once sworn that I could drag/drop rearrange the DB tables right in the UI also. Smiley Happy But export to CSV, clear the DB, rearrange data in CVS, and import back to DB, is the only way I seem to be able to make things behave currently. Thank you for lending your voice to the conversation. If we get enough people in here, maybe it'll get fixed.

Regular Contributor

@Crystal_Hopper , it's comforting to hear I'm not loosing my mind ;-) and others remember having such funcitonality in the hubDB UI at some point in time.  HS Support @NiallByrne  couldn't find any HS developer there that recalls this. I really hope too that HS product management will consider prioritizing development for this. 

New Member

I second @Crystal_Hopper suggestion. I wish there was a simpler way to re-order the HubDB records within admin without having to export, re-order in a spreadsheet, and re-upload. If data is always changing in those tables, this is not a scalable solution.

Regular Contributor | Diamond Partner
Regular Contributor | Diamond Partner

This would be beyond amazing if we can get this feature Smiley Happy

Occasional Contributor

Unbelieveable. I mean, if you have more than even a dozen records/rows, HubDB tables are hard to manage/edit. We just redesigned our site to use HubDB for event listings and our resource page. It's incredibly time consuming to manage.

 

Please HubSpot, update the functionality of the HubDB editor!

 

- Drag & Drop Sorting

- Filter by Column

- Search within Table