# Filter HubDB by row using Hubl

**URL:** <https://community.hubspot.com/t/filter-hubdb-by-row-using-hubl/8406>\
**Category:** CMS Development\
**Created:** [April 5, 2018, 8:13pm UTC](https://community.hubspot.com/t/filter-hubdb-by-row-using-hubl/8406 "2018-04-05T20:13:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![josephLayden](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/josephlayden/32/68653_2.png) [@josephLayden](https://community.hubspot.com/u/josephLayden)\
**Post date:** [April 5, 2018, 8:13pm UTC](https://community.hubspot.com/t/filter-hubdb-by-row-using-hubl/8406/1 "2018-04-05T20:13:05Z")

</div>

I am trying to create a listing page that provides a links by state. The example below, would show all press releases from California tagged ‘CA’ in the row ‘State’

```auto
{% set table = hubdb_table_rows(679969, queryparam) %}

{% if table == [] %}
<p class='align-center'>Sorry, no listings found for that Search. Try changing your fiter and search again.</p>
{% else %}

{% if row["state"] in table == "CA" %}

<div class="container row-fluid">
 <div class="state-post-listing">
 <ul>	
 <li><a href="{{ row['embed'] }}">{{ row["date"]|datetimeformat('%A %e %B %Y') }} | {{ row['name'] }} | {{ row['state'] }}<a/></li>
 </ul>
 </div>
</div>

{% endif %}

{% endif %}

```

---

<div class="post-metadata">

**Author:** ![roisinkirby](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@roisinkirby](https://community.hubspot.com/u/roisinkirby)\
**Post date:** [April 6, 2018, 11:18am UTC](https://community.hubspot.com/t/filter-hubdb-by-row-using-hubl/8406/2 "2018-04-06T11:18:42Z")

</div>

Hey @josephLayden does this solution from @TRooInbound help? [https://community.hubspot.com/t5/Content-Design-Questions/HubDB-Filtering-based-on-dynamic-page-data/m-p/36630](https://community.hubspot.com/t5/Content-Design-Questions/HubDB-Filtering-based-on-dynamic-page-data/m-p/36630)

---

<div class="post-metadata">

**Author:** ![josephLayden](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/josephlayden/32/68653_2.png) [@josephLayden](https://community.hubspot.com/u/josephLayden)\
**Post date:** [April 6, 2018, 5:03pm UTC](https://community.hubspot.com/t/filter-hubdb-by-row-using-hubl/8406/3 "2018-04-06T17:03:31Z")

</div>

I did not have the correct logic. I fixed the problem by adding ‘state=CA’ where state is the name/ID of the row and CA is the value i am sorting for.

```auto
{% set table = hubdb_table_rows(679969, 'state=CA') %}

{% if table == [] %}
<p class='align-center'>Sorry, no listings found for that Search. Try changing your fiter and search again.</p>
{% else %}

{% for row in table %}

<div class="container row-fluid">
 <div class="state-post-listing">
 <ul>	
 <li><a href="{{ row['embed'] }}">{{ row['date'] }} | {{ row['name'] }} | {{ row['state'] }}<a/></li>
 </ul>
 </div>
</div>

{% endfor %}
{% endif %}

```
