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”).
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.
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.
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.
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.
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).
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).