# case insensitive in hubdb query

**URL:** <https://community.hubspot.com/t/case-insensitive-in-hubdb-query/75109>\
**Category:** APIs & Integrations\
**Created:** [February 13, 2023, 8:06pm UTC](https://community.hubspot.com/t/case-insensitive-in-hubdb-query/75109 "2023-02-13T20:06:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [February 13, 2023, 8:06pm UTC](https://community.hubspot.com/t/case-insensitive-in-hubdb-query/75109/1 "2023-02-13T20:06:25Z")

</div>

I’m creating a drop down filter from cities in a hubdb table and getting duplicates because of some are all uppercase and some are lowercase. How do I search for and group by city without case sensitivity?  
If I change them all to group.grouper|upper then it the returned query only retrives those that are all upper and vice versa …

```lia-code-sample
 {% if request.query_dict.region gt '' %}
 <div class="input-group-prepend">
 <select id="city" name="city" class="form-control formInput">
 <option value="" {% if request.query_dict.city eq '' %}selected="selected"{% endif %}>ALL CITIES</option>
 {% for group in hubdb_table_rows(dynamic_page_hubdb_table_id,'limit=9999&orderBy=city'+queryparam_cs)|groupby("city") %}
 <option value="{{ group.grouper}}" 
 {% if request.query_dict.city eq group.grouper %}selected="selected"{% endif %}
 >{{ group.grouper}}</option>
 {% endfor %}
 </select>
 </div> 
 {% endif %}

```

After this drop down based on the queryparam I then use ot to search the HUbdb

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [February 14, 2023, 9:38pm UTC](https://community.hubspot.com/t/case-insensitive-in-hubdb-query/75109/2 "2023-02-14T21:38:44Z")

</div>

Hi, @Anonymous 👋 Thanks for reaching out! Let’s see if we can get the conversation going — hey @carolgiacon @Josh do you have any suggestions for @Anonymous? Or thoughts on other ways they can approach this project?

Thank you! — Jaycee

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [February 21, 2023, 5:22pm UTC](https://community.hubspot.com/t/case-insensitive-in-hubdb-query/75109/3 "2023-02-21T17:22:41Z")

</div>

Hi [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074), do know of anyone else that might be able to help me? Thank you
