# HubDB queryparam from user input

**URL:** <https://community.hubspot.com/t/hubdb-queryparam-from-user-input/64169>\
**Category:** CMS Development\
**Tags:** design-manager, hubdb, javascript, html\
**Created:** [August 31, 2022, 12:57pm UTC](https://community.hubspot.com/t/hubdb-queryparam-from-user-input/64169 "2022-08-31T12:57:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlfredLundqvist](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@AlfredLundqvist](https://community.hubspot.com/u/AlfredLundqvist)\
**Post date:** [August 31, 2022, 12:57pm UTC](https://community.hubspot.com/t/hubdb-queryparam-from-user-input/64169/1 "2022-08-31T12:57:44Z")

</div>

Is it possible, and if so how, to use the selected option from a dropdown list as a queryParam of another query

```lia-code-sample
<select id="chooseOffice">
 <option value="all">All</option>
 {% set offices = hubdb_table_rows(XXXX) %}
 {% for row in offices %}
 <option value="{{ row.name }}">{{ row.name }}</option> 
 {% endfor %}
</select>

/* Here i want the selected option from 'offices' above to be 'queryParam' of the list below. 

{% set queryParam = ???? %}

*/

<div class="employee-list"> 
 {% set employees = hubdb_table_rows(YYYY, queryParam) %} 
 {% for row in employees %} 
 <div class="single-employee-wrapper"></div>
 {% endfor %}
</div>
	​

```

---

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [August 31, 2022, 1:34pm UTC](https://community.hubspot.com/t/hubdb-queryparam-from-user-input/64169/2 "2022-08-31T13:34:41Z")

</div>

I’d use the select to set a query string on the url. Then call the param in your hubDB query

request.query\_dict.YOUR\_PARAM

Oh, you’ll probably also need a version of your HubDB call without the parameter for when there’s no string query.

* * *

 ![profile2022a.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7273a34ccfe3489fceebc8a36eca751481b59531.jpeg)

**Barry Grennan**

[Freelance HubSpot CMS Developer](https://www.seoanseo.ca?utm_source=HubSpotCommunity)

[Website](https://www.seoanseo.ca?utm_source=HubSpotCommunity) | [Contact](https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity)

---

<div class="post-metadata">

**Author:** ![AlfredLundqvist](https://avatars.discourse-cdn.com/v4/letter/a/f9ae1b/32.png) [@AlfredLundqvist](https://community.hubspot.com/u/AlfredLundqvist)\
**Post date:** [September 1, 2022, 12:49pm UTC](https://community.hubspot.com/t/hubdb-queryparam-from-user-input/64169/3 "2022-09-01T12:49:12Z")

</div>

Thanks for the reply. Would this solution need a page refresh in order to work, or can it be solved without a page refresh? The latter would be prefrerred.

---

<div class="post-metadata">

**Author:** ![BarryGrennan](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/barrygrennan/32/97794_2.png) [@BarryGrennan](https://community.hubspot.com/u/BarryGrennan)\
**Post date:** [September 1, 2022, 1:05pm UTC](https://community.hubspot.com/t/hubdb-queryparam-from-user-input/64169/4 "2022-09-01T13:05:00Z")

</div>

Yes it would require a page refresh. You can’t feed live data into a hubl function like that.

To do that you’d need to use the API.

A possible work around if you’re set on not having a page refresh and can’t go the API route would be to display all as default. Then hide the non-selected items when the drop-down is set. Use JavaScript to set a hide class on non-selected ones or something like that.

* * *

 ![profile2022a.jpg](https://d2qpr2jzcazej7.cloudfront.net/original/2X/7/7273a34ccfe3489fceebc8a36eca751481b59531.jpeg)

**Barry Grennan**

[Freelance HubSpot CMS Developer](https://www.seoanseo.ca?utm_source=HubSpotCommunity)

[Website](https://www.seoanseo.ca?utm_source=HubSpotCommunity) | [Contact](https://www.seoanseo.ca/#contact?utm_source=HubSpotCommunity)
