Forum Academy Marketplace Showcase Pricing Features

Sorting on 3 fields at the same time

Hi, I’m currently struggling with filtering for my repeating group.
I have a data type contact with for example 3 fields: firstname, lastname, company.

I’ve an input field (not search field). I want to find entries based on that at least 1 of the 3 fields should contain the searched term.

If I type ‘A’, I want to show all entries with A in firstname or lastname or company.
Also, I don’t want case sensitivity. My idea for searching on 1 field was using an advanced filter:

“The contact’s : lowercase contains Input SearchBox’s value: formatted as text:lowercase”

But unfortunately, this does not work b/c of a syntax error (and would only work for search on one field, not 3 at a time).

So: What is the correct way of doing this? Don’t think I’m the first with this kind of problem.

Thanks a lot :))

There are quite a few ways to do this, and they have varying degrees of speed/set-up time. (as is custom in bubble)

An easy but slow way which comes to mind is setting the data source of the repeating group as three "do a search for"s all of which are merged. This works decently if you don’t have a lot of data base entries, but might start slowing down if your app scales.

There is a much faster way, but it requires more set-up work, back-end maintenance etc. You could set up a text field in your user data thing that is a string of all your search parameters. Eg “John Smith Company”, which would act as your search field. This would allow you to retrieve your desired users by doing a single search, rather than three. You have to set up workflows to create this field when a user signs up, workflows to correct this field when a user changes info. And if your app is already live, you need to create this field for existing users.

I am sure there are other ways, (and probably better ways) but this could get you headed in the right direction.

Thanks for your reply, I implemented your second suggestion - which works pretty fine & fast for me.

Little hind: Append every search-able field into the search-field as lowercase and filter on input’s value:lowercase - thus case sensitivity is eliminated too.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.