# 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:** 1\
**Showing post:** 3

<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 %}

```

---

_[View the full topic](https://community.hubspot.com/t/filter-hubdb-by-row-using-hubl/8406)._
