# Querying Parameter Help

**URL:** <https://community.hubspot.com/t/querying-parameter-help/34744>\
**Category:** CMS Development\
**Tags:** hubdb\
**Created:** [March 30, 2021, 3:29pm UTC](https://community.hubspot.com/t/querying-parameter-help/34744 "2021-03-30T15:29:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![DPicklo](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dpicklo/32/33328_2.png) [@DPicklo](https://community.hubspot.com/u/DPicklo)\
**Post date:** [March 30, 2021, 3:29pm UTC](https://community.hubspot.com/t/querying-parameter-help/34744/1 "2021-03-30T15:29:02Z")

</div>

I followed a walkthrough on how to set up a multifield form that can be used to query a HubDB table and it works well enough with some slight issues. I want it to work so that when only one selection is made from the options, it will still query even if the other fields are blank. Currently, all dropdown fields must be filled in order to query. I’m sure I’m missing something here that is staring me in the face!

Here is what I’ve got set up for the query:

```lia-code-sample
{% set queryparam = "" %}

{% if request.query_dict.location != "" %}
 {% set queryparam = queryparam+"&location__icontains="~request.query_dict.location|urlencode %}
{% endif %}

{% if request.query_dict.country !="" %}
 {% set queryparam = queryparam+"&country="~request.query_dict.country|urlencode %}
{% endif %}

{% if request.query_dict.category != "" %}
 {% set queryparam = queryparam+"&content__icontains="~request.query_dict.category|urlencode %}
{% endif %}

{% if request.query_dict.contact != "" %}
 {% set queryparam = queryparam+"&contact_type="~request.query_dict.contact|urlencode %}
{% endif %}

```

Any advice on how to approach this is greatly appreciated! Thanks!

---

<div class="post-metadata">

**Author:** ![alyssamwilie](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/alyssamwilie/32/2072_2.png) [@alyssamwilie](https://community.hubspot.com/u/alyssamwilie)\
**Post date:** [March 30, 2021, 3:41pm UTC](https://community.hubspot.com/t/querying-parameter-help/34744/2 "2021-03-30T15:41:09Z")

</div>

@DPicklo  
If you just remove the

`!= "" `

from your if statements it should work.

---

<div class="post-metadata">

**Author:** ![DPicklo](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dpicklo/32/33328_2.png) [@DPicklo](https://community.hubspot.com/u/DPicklo)\
**Post date:** [March 30, 2021, 6:59pm UTC](https://community.hubspot.com/t/querying-parameter-help/34744/3 "2021-03-30T18:59:04Z")

</div>

Hey thanks! I figured it would be a simple solution like that, just didn’t know what else to try.

Take care!
