# pulling data from multiple columns HubDB HubL

**URL:** <https://community.hubspot.com/t/pulling-data-from-multiple-columns-hubdb-hubl/20924>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [May 15, 2020, 5:24pm UTC](https://community.hubspot.com/t/pulling-data-from-multiple-columns-hubdb-hubl/20924 "2020-05-15T17:24:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ziadi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ziadi/32/84083_2.png) [@ziadi](https://community.hubspot.com/u/ziadi)\
**Post date:** [May 15, 2020, 5:24pm UTC](https://community.hubspot.com/t/pulling-data-from-multiple-columns-hubdb-hubl/20924/1 "2020-05-15T17:24:21Z")

</div>

Hello all,

I want to combine dataasets from two columns from a hubDB table and pull the data into a filter. Here is a part of the code that I am using below:

```auto
<div id="container">
 {% set table = hubdb_table_rows(2034103) %}
 {% for row in table %}
 <div class="item {% for category in row.filter_item %}{{ category.name|lower|replace('|', '_')|replace('.', '')|replace('/', '_')|replace(' ', '_') }} {% endfor %}">
 <div class="item-inner">
 <h3>{{ row.Name }}</h3>
 <div class="grid-descr">
 {{ row.content }}
 </div>
 <a href="{{ row.button_link }}" target="_blank" class="learn_more_btn">Learn More</a>
 </div>
 </div>
 {% endfor %}
 </div>
</div>

```

I tried the following for this specific snippet (changes shown in red):

` <div class="item {% for category in (row.filter_item or row.molecule_class) %}{{ category.name|lower|replace('|', '_')|replace('.', '')|replace('/', '_')|replace(' ', '_') }} {% endfor %}">`

because I wanted to combine the two columns and pull data from both columns.. but it doesn’t seem to be working for me for some reason. Am I doing anything wrong? Is this the correct way to combine columns?

Thanks!

---

<div class="post-metadata">

**Author:** ![sharonlicari](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/sharonlicari/32/101479_2.png) [@sharonlicari](https://community.hubspot.com/u/sharonlicari)\
**Post date:** [May 19, 2020, 3:54pm UTC](https://community.hubspot.com/t/pulling-data-from-multiple-columns-hubdb-hubl/20924/2 "2020-05-19T15:54:36Z")

</div>

Hey @ziadi

Thank you for the information provided. I’ll tag a few experts  
 ![16x16_smiley-happy.png.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/2/22d5e40d253def47f5f4ea7f0e3e70be19010689.png)

Hey @Dennis-DWFB @DanielSanchez @Anonymous do you have any thoughts you’d like to share with @ziadi

Thank you

Sharon

---

<div class="post-metadata">

**Author:** ![Kevin-C](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/kevin-c/32/34570_2.png) [@Kevin-C](https://community.hubspot.com/u/Kevin-C)\
**Post date:** [May 19, 2020, 7:58pm UTC](https://community.hubspot.com/t/pulling-data-from-multiple-columns-hubdb-hubl/20924/3 "2020-05-19T19:58:18Z")

</div>

Hey @ziadi

If you’re just looking to template that class in couldn’t you just use 2 separate loops?

Something like this:

`<div class="item {% for category in row.filter_item %}{{ category.name|lower|replace('|', '_')|replace('.', '')|replace('/', '_')|replace(' ', '_') }} {% endfor %} {% for category in row.molecule_class %}{{ category.name|lower|replace('|', '_')|replace('.', '')|replace('/', '_')|replace(' ', '_') }} {% endfor %}">`

---

<div class="post-metadata">

**Author:** ![ziadi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/ziadi/32/84083_2.png) [@ziadi](https://community.hubspot.com/u/ziadi)\
**Post date:** [May 19, 2020, 8:01pm UTC](https://community.hubspot.com/t/pulling-data-from-multiple-columns-hubdb-hubl/20924/4 "2020-05-19T20:01:34Z")

</div>

Ah that just might be the missing link, i will try that! I am not very familiar with HubL or HubDB… appreciate the feedback!
