# HubDB filter

**URL:** <https://community.hubspot.com/t/hubdb-filter/99727>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [February 7, 2024, 9:26pm UTC](https://community.hubspot.com/t/hubdb-filter/99727 "2024-02-07T21:26:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cives](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cives/32/57633_2.png) [@cives](https://community.hubspot.com/u/cives)\
**Post date:** [February 7, 2024, 9:26pm UTC](https://community.hubspot.com/t/hubdb-filter/99727/1 "2024-02-07T21:26:39Z")

</div>

If I want to execute a code block differently depending on HubDB input, is this the right approach?

I have a hubdb checkbox column called “external”

```lia-code-sample
{% for row in hubdb_table_rows('2620345', "&orderBy=date&visible=true") %}

{% if row.external = null %}

[code 1 here]

{% else %}

[code 2 here]

{% endif %}
{% endfor %}

```

The line {% if row.external = null %} is not filtering the data correctly.

Do I have that formatted wrong?

If external is checked off, I’d like to make alterations to the code, changing the functionality.

---

<div class="post-metadata">

**Author:** ![evaldas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evaldas/32/69160_2.png) [@evaldas](https://community.hubspot.com/u/evaldas)\
**Post date:** [February 7, 2024, 10:41pm UTC](https://community.hubspot.com/t/hubdb-filter/99727/2 "2024-02-07T22:41:04Z")

</div>

Hi @cives,

If you are trying to set logic based on a checkbox value in HubDB, you can try updating your code to have the following:

{% if row.external == 0 %}

Note that you want to use the double equal sign “==” as the single is typically used to assign a value to a variable. The “external” should return either a 1 or 0 to reflect true/false.

* * *

Did my post help answer your query? Help the community by marking it as a solution.

---

<div class="post-metadata">

**Author:** ![evaldas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evaldas/32/69160_2.png) [@evaldas](https://community.hubspot.com/u/evaldas)\
**Post date:** [February 13, 2024, 4:33pm UTC](https://community.hubspot.com/t/hubdb-filter/99727/3 "2024-02-13T16:33:42Z")

</div>

@cives Alternatively, you can also use the following:

```lia-code-sample
{% for row in hubdb_table_rows('2620345', "&orderBy=date&visible=true") %}

{% if !row.external %}

[code 1 here]

{% else %}

[code 2 here]

{% endif %}
{% endfor %}

```
