# Why oh why am I unable to search the DB case insensitive?

**URL:** <https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477>\
**Category:** Database\
**Created:** [May 23, 2019, 2:16pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477 "2019-05-23T14:16:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [May 23, 2019, 2:16pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/1 "2019-05-23T14:16:27Z")

</div>

@Bubble,

I want to search for a value using “Do a search for” case insensitive. Since “Do a search for” requires a value, and it seems it’s case sensitive, it’s unable to find all potential values with the same characters.

Let’s say I have a Data type with a Company Name field and Microsoft already exists. When someone else tries to add a new record with the same Company Name I want to disallow submission. So I want to ensure that all variations of case that a user types into an input field (“microsoft”, “MICROSOFT”, “MicRosoft”) is able to match the value already in the database (“Microsoft”).

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/0/4/04091a35a316dc3b00056ea616b9c0edfdded928.png)

---

<div class="post-metadata">

**Author:** ![mebeingken](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mebeingken/32/20139_2.png) [@mebeingken](https://forum.bubble.io/u/mebeingken)\
**Post date:** [May 23, 2019, 3:09pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/2 "2019-05-23T15:09:12Z")

</div>

Hey Keith,

Right there with you on this…wish it was easier than what I outlined here:

> [@Ensuring case sensitive unique usernames with only specific characters](http://forum.bubble.io/t/ensuring-case-sensitive-unique-usernames-with-only-specific-characters/46541/5):
>
> Hey @marcuslate, Here’s one way of doing it: [username] It uses the free [Instant Text plugin](https://bubble.io/plugin/instant-text-1527871417291x467091680897007600) as this gives immediate feedback to the user, rather than waiting for the delay in a standard input. As much as I hate storing data in multiple places, I think that is really the easiest here, so this solution relies on storing the username in two fields, one for the original display and another that should always be lowercase. If you really don’t want to store two values, you could do the lowercase…

There were other requirements as well, but this shows one way to do the unique username portion.

–Ken

---

<div class="post-metadata">

**Author:** ![eren](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/eren/32/92848_2.png) [@eren](https://forum.bubble.io/u/eren)\
**Post date:** [May 23, 2019, 3:52pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/3 "2019-05-23T15:52:27Z")

</div>

Thank you @mebeingken

It worked for me 🙂

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [May 23, 2019, 4:53pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/4 "2019-05-23T16:53:38Z")

</div>

Thanks Ken! Having to create duplicate fields, just to make one lowercase, is a real pain.

---

<div class="post-metadata">

**Author:** ![neerja](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/neerja/32/29814_2.png) [@neerja](https://forum.bubble.io/u/neerja)\
**Post date:** [May 23, 2019, 9:08pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/5 "2019-05-23T21:08:47Z")

</div>

@Kfawcett @mebeingken Our engineering team will review this request

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [May 23, 2019, 10:16pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/6 "2019-05-23T22:16:51Z")

</div>

Thanks @neerja!

---

<div class="post-metadata">

**Author:** ![Lucien](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/lucien/32/58216_2.png) [@Lucien](https://forum.bubble.io/u/Lucien)\
**Post date:** [May 24, 2019, 5:07am UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/7 "2019-05-24T05:07:12Z")

</div>

Strangely enough, when you filter a search with “any field contains” (an input’s value for example) it does perform a case insensitive comparison. But I guess that doesn’t work for you, @Kfawcett as you only want to perform the comparison with one single field, not any field.

---

<div class="post-metadata">

**Author:** ![JonL](https://avatars.discourse-cdn.com/v4/letter/j/e5b9ba/32.png) [@JonL](https://forum.bubble.io/u/JonL)\
**Post date:** [May 24, 2019, 6:05am UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/8 "2019-05-24T06:05:13Z")

</div>

You may be unable, but Bubble actually isn’t. So talking about workarounds.

Data API will do case insensitive search for you **server-side**.

```
https://yourapp/version-test/api/1.1/obj/thingname?constraints=[
	{
	"key":"fieldname",
	"constraint_type":"text contains",
	"value": "value"          
	}
]

```

You could potentially expose Data API for that thing and create a privacy rule for the field you want to search. If response.count is != 0 you have a match.

```
{
    "response": {
        "results": [
            {
                // Results
            }
        ],
        "cursor": 0,
        "count": 1,
        "remaining": 0
    }
}

```

Or Bubble could just expose the option in the editor given that this is already built 🙂

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [May 24, 2019, 6:34am UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/9 "2019-05-24T06:34:46Z")

</div>

Convert the input into Upper Case in a hidden input field …

The do an advanced search on the database field :uppercase = hidden field’s value

[https://buildingonbubble.com/block/search-ignoring-case-1473495213720x341425763853008900](https://buildingonbubble.com/block/search-ignoring-case-1473495213720x341425763853008900)

---

<div class="post-metadata">

**Author:** ![gf\_wolfer](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gf_wolfer/32/262456_2.png) [@gf\_wolfer](https://forum.bubble.io/u/gf_wolfer)\
**Post date:** [May 24, 2019, 12:59pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/10 "2019-05-24T12:59:03Z")

</div>

It would be good to have a checkbox ‘Ignore case sensitivity’ when doing the search.

I also noticed the Search bar in the Editor’s Data tab is case insensitive, so I am guessing this is something they could do

---

<div class="post-metadata">

**Author:** ![taylorhlabs](https://avatars.discourse-cdn.com/v4/letter/t/e9bcb4/32.png) [@taylorhlabs](https://forum.bubble.io/u/taylorhlabs)\
**Post date:** [September 11, 2020, 3:39am UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/11 "2020-09-11T03:39:44Z")

</div>

Since it seems it’s still not straightforward to do a case insensitive search, I added a “Searchable Text” field to Type Board which is the type I’m trying to search on the front end. When creating or updating a Type Board object, I combine the Board Title field with a couple other short text fields I want to include in the search then save a single string to the Searchable Text field AND convert it to lowercase so I can run searches on that one field. I don’t like duplicating data, especially if it’s large text fields, but this seems like the easiest workaround for now. Plus it makes searching multiple text fields a bit more straightforward since you only have to search one field.

You can see the front end Search statement in the screenshot.

 ![search case insensitive workaround](https://us1.discourse-cdn.com/bubble/original/3X/d/a/dacd82389e611491153951ae41b247c79af92a88.jpeg)

---

<div class="post-metadata">

**Author:** ![GuyRoss](https://avatars.discourse-cdn.com/v4/letter/g/a698b9/32.png) [@GuyRoss](https://forum.bubble.io/u/GuyRoss)\
**Post date:** [October 28, 2020, 8:08pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/12 "2020-10-28T20:08:22Z")

</div>

> [@NigelG](#):
>
> [https://buildingonbubble.com/block/search-ignoring-case-1473495213720x341425763853008900](https://buildingonbubble.com/block/search-ignoring-case-1473495213720x341425763853008900)

How can I filter with “any field contains”…?? That would be amazing

---

<div class="post-metadata">

**Author:** ![Pat](https://avatars.discourse-cdn.com/v4/letter/p/8491ac/32.png) [@Pat](https://forum.bubble.io/u/Pat)\
**Post date:** [December 13, 2020, 10:19pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/13 "2020-12-13T22:19:44Z")

</div>

strange that this is still an issue after this has been raised many times, many years ago.

> [@Why is the search box case sensitive](http://forum.bubble.io/t/why-is-the-search-box-case-sensitive/1408):
>
> It appears that the search box is case sensitive. how can i disable this?

---

<div class="post-metadata">

**Author:** ![nomads32n](https://avatars.discourse-cdn.com/v4/letter/n/ea666f/32.png) [@nomads32n](https://forum.bubble.io/u/nomads32n)\
**Post date:** [February 18, 2021, 11:40pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/14 "2021-02-18T23:40:01Z")

</div>

Has this been resolved?

---

<div class="post-metadata">

**Author:** ![icaroludwig](https://avatars.discourse-cdn.com/v4/letter/i/b9bd4f/32.png) [@icaroludwig](https://forum.bubble.io/u/icaroludwig)\
**Post date:** [February 19, 2021, 12:14pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/15 "2021-02-19T12:14:03Z")

</div>

Has this been already solved?

---

<div class="post-metadata">

**Author:** ![homeschoolmoment](https://avatars.discourse-cdn.com/v4/letter/h/ecccb3/32.png) [@homeschoolmoment](https://forum.bubble.io/u/homeschoolmoment)\
**Post date:** [April 7, 2021, 6:43pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/17 "2021-04-07T18:43:53Z")

</div>

I set a custom state on the input called lowercase. When the input is changed, I update it to the value of the input converted to lowercase, then when filtering I use the lowercase state instead of the input value.

---

<div class="post-metadata">

**Author:** ![maidl.dev](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@maidl.dev](https://forum.bubble.io/u/maidl.dev)\
**Post date:** [June 29, 2021, 11:22am UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/18 "2021-06-29T11:22:44Z")

</div>

This VERY simple… no need plugins , just do this:  
I used a type PISSOAS  
when you click your SAVE button, the workflow will be something like this:

 ![forum](https://us1.discourse-cdn.com/bubble/original/3X/7/3/7376a4b49d78e59dad07120d28592d6a7dda43be.png)

Nothing else. Now you have a case insensitive search.  
Hope this help you all.

---

<div class="post-metadata">

**Author:** ![umiumansa](https://avatars.discourse-cdn.com/v4/letter/u/ccd318/32.png) [@umiumansa](https://forum.bubble.io/u/umiumansa)\
**Post date:** [July 14, 2021, 2:29pm UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/19 "2021-07-14T14:29:07Z")

</div>

Yeah… I’m reading this thread and still don’t understand whether yes or no I can do a search with _any field contains_ case insensitively.

I’m searching through a library of books and would like to search for any fields, author, titles etc. without having to worry about case sensitivity.

Please help.

---

<div class="post-metadata">

**Author:** ![m.bb](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@m.bb](https://forum.bubble.io/u/m.bb)\
**Post date:** [July 31, 2021, 7:36am UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/20 "2021-07-31T07:36:44Z")

</div>

Looks like:

ANY FIELD CONTAINS = is case insensitive, yes.  
But it behaves like CONTAINS KEYWORD(S) → only searches for full words and not like CONTAINS for fragments.

So not really a solution in many cases (e.g. in mine).

---

<div class="post-metadata">

**Author:** ![m.bb](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@m.bb](https://forum.bubble.io/u/m.bb)\
**Post date:** [July 31, 2021, 7:44am UTC](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477/21 "2021-07-31T07:44:56Z")

</div>

Any news or new ideas anybody?

I would be happy if:  
a) I could simply apply :lowercase on both sides of the search constraint (data thing field + Input field) whereas it is currently only possible on the input side.  
b) there is a way to define that this condition of the search should be executed case insensitive on the backend side.

Note: I can’t use the advanced filter & hidden field workaround suggested by the always inventive @NigelG as I don’t want to do it on the client side (the dataset is expected to grow too large).

[Next page](https://forum.bubble.io/t/why-oh-why-am-i-unable-to-search-the-db-case-insensitive/57477.md?page=2)
