HubDB & Hubl: Output multi-select options in hubdb_table_rows using nested loop (How-to)

CR Rollyson
3 min readApr 4, 2024

--

Like everything else, it makes perfect sense once you know how-to.

HubDB Columns of Multi-Select type are accessed as nested rows. To get to the multi-select options of a row, you can simply nest a row for loop inside a table for loop, with dot syntax using the HubDB Multi-Select Column Name.

Grab the code below:

HubDB Multi-Select Type Column for Bands — Table View
HubDB Multi-Select Type Column for Bands — Column Edit View
Hubl Code Multi-Select Type Column for Bands — Nested For Loop to access selected options
Hubl HTML Output Multi-Select Type Column for Bands — Nested For Loop displaying HubDB table info and selected options

Grab the code

{% for row in hubdb_table_rows('00000000') %}
<h3>
Row Name: {{ row.name }}
</h3>
<p>
Row Multi-Select Options Count: {{ row.bands|length }}
</p>
<ul>
{% for foreign_row in row.bands %}
<li>Multi-Select Option: {{ foreign_row.name }}</li>
{% endfor %}
</ul>
{% endfor %}

Try it out

Step 1 in Hubspot HubDB

  1. [in hubdb] Create a HubDB table
  2. [in hubdb] Create a Multi-Select Column called Bands and add your favorite bands as options
  3. [in hubdb] Create a new Row, using your name for the Name Column and select some / all your favorite bands in the multi-select column
  4. [in hubdb] Publish HubDB table (getting the information in Hubl isn’t accessible until you publish the table)

Step 2 in Hubspot Design Manager

  1. [in design manager] Create a new module/file or use with Hubl (or use an existing that accepts Hubl)
  2. [in design manager] Paste code from above
  3. [in design manager] Update hubdb_table_rows(‘00000000’) with your HubDB table number
  4. [in design manager] Preview the page

You should see something like this in the preview:

If you try and it doesn’t work, message me. Happy to help.

That’s a wrap.

Have marketing questions? Need Hubspot support? Wonder why WordPress constantly breaks on updates and/or have 3rd-party security app nightmares (elementor) that keep you up at night?

Wonder why Google Search Campaigns flood your conversions with odd seemingly similar names all with Gmail accounts even while following Google Ads recommendations and they refuse a refund?

Unsure why your business .com email is doing weird things and shooting to spam after the new DMARC settings update? Or why your CRM or email service is shouting warnings about not being setup correctly?

At a loss why pages on your website that ranked in SERPs last week are no longer ranking AT ALL after the March Google search algorithm update?

I have answers and excited to share insights with you or happy to help get the fixes implemented myself.

Hit this link to book a 15 minute fit call with me to see if we’d good working together (in a normally human and professional way, with ease).

CR Rollyson is a Digital User Experience & Web Manager for a S&P 500 Fintech company and is the COO of Side Role, a marketing team in Charlotte North Carolina partnering with In-house Teams & Agencies, Non-profits, and Start-Ups. Learn more about Side Role here.

--

--

CR Rollyson

UX & Web mgr for a S&P 500 Fintech & COO of Side Role, a marketing team partnering w In-house Teams & Agencies, Non-profits, & Start-Ups. https://siderole.com