# Pulling all relevant results from HubDB Multi-Select

**URL:** <https://community.hubspot.com/t/pulling-all-relevant-results-from-hubdb-multi-select/10878>\
**Category:** CMS Development\
**Created:** [November 9, 2018, 7:56pm UTC](https://community.hubspot.com/t/pulling-all-relevant-results-from-hubdb-multi-select/10878 "2018-11-09T19:56:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MitchL](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mitchl/32/98942_2.png) [@MitchL](https://community.hubspot.com/u/MitchL)\
**Post date:** [November 9, 2018, 7:56pm UTC](https://community.hubspot.com/t/pulling-all-relevant-results-from-hubdb-multi-select/10878/1 "2018-11-09T19:56:36Z")

</div>

Hey there, I’m trying to filter and display results from a HubDB table. I’ve followed this tutorial with much success: [GitHub - HubSpot/cms-custom-objects-example · GitHub](https://designers.hubspot.com/docs/tutorials/how-to-build-a-real-estate-listing-with-hubdb)

However, I ran into an issue when trying to query the table for all rows that contain and certain value in their Multi-Select. I’m using “&categories=\<multi-select-option-id\>” as my parameters, and it is succeessfully pulling rows that have the specific option selected. I run into the problem with rows that have more than one option selected in the multi-select though.

 ![Screen Shot 2018-11-09 at 1.51.28 PM.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/7/57b7a5841ddb7f245b0fd4264c6b7bc635567b78.png)

{# paramaters #}

{% set queryparam = queryparam ~ “&categories=”~request.query\_dict.categories|urlencode %}

{# Query #}

{% for row in hubdb\_table\_rows(dynamic\_page\_hubdb\_table\_id, queryparam)|sort(False, False, ‘name’) %}

Ex: “Dropship” is the 4th option in the multiselect. So if I use “&categories=4” as my parameters, all of the rows that have only “Dropship” selected in the multi-select will be returned, excluding those that have “Dropship” and others selected.

Does anyone know how to expand these paramaters to check if the desired option is listed among a multi-select that has multiple options selected?

---

<div class="post-metadata">

**Author:** ![MitchL](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/mitchl/32/98942_2.png) [@MitchL](https://community.hubspot.com/u/MitchL)\
**Post date:** [November 9, 2018, 9:25pm UTC](https://community.hubspot.com/t/pulling-all-relevant-results-from-hubdb-multi-select/10878/2 "2018-11-09T21:25:14Z")

</div>

Nevermind! I was able to find I solution by comparing their ids using

{% for category in row.categories %}  
{% if category.id == request.query\_dict.categories%}

…

{% endif %}

{% endfor %}

---

<div class="post-metadata">

**Author:** ![stabuenca](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stabuenca/32/8409_2.png) [@stabuenca](https://community.hubspot.com/u/stabuenca)\
**Post date:** [February 7, 2019, 5:19pm UTC](https://community.hubspot.com/t/pulling-all-relevant-results-from-hubdb-multi-select/10878/3 "2019-02-07T17:19:35Z")

</div>

You have an easy solution if you add this sufix to your variable: \_\_contains=
