Forum Academy Marketplace Showcase Pricing Features

Creating a search function

I’m building a library of case, users can add a photo with description and tags.
Other users can view and search cases that are already in the database. I would like to allow users to search within tags and description for keywords and find case interesting for them.

Adding photos works but I can’t figure out how to create a search.

1 Like

What you are trying to do is a full text search on a type. We have that feature on the Repeating Group element. Of course, you want to define your type (Case Entry) first.

Here’s one way to do it
On a Repeating Group, pick “Do a search for…” in the Data Source field, and pick your type (let’s call it Case Entry), then pick “Any field contains” and use an input box as your dynamic data source.

It should look something like this:

Please see https://bubble.io/reference#Data.SearchOperator.AnyField for more details.

1 Like

Thanks for help.
This works fine if you stay on the same page. Do you know how I can pass the query entered in the search text box to the other page in my app? I tried to use “Get ? parameter from page url” but I couldn’t find any way to make Bubble put text entered by the user into the url parameter to pass it on.

You can set the page to have a type, and then when you do the navigation you can “send”

In this case you could store the query on a thing and pass this.

Alternatively you could store the “latest search” on the User.

Passing around things in the URL is going to be harder than either of these I would say.

Nigel is right.
Here’s a tutorial that demonstrates that process: https://bubble.io/page?type=page&name=index&id=learn&tab=tabs-1&lesson_ref=9

@georgeciobanu this is is a very helpful answer. The only issue with this is that partial matches are not found - so ‘Smith’ returns a person, not ‘smi’.

Also, whilst if a standard input is used, automated search happens as you type without hitting return, but not if a search box is used. It makes sense to enable any field search to search boxes too- why was this not the case?

I was trying to do a Auto-complete search feature, but the focus group only appears if I stay with the mouse clicked on. If I unclick it disappears.

In other hand, if I input the info that I’m looking for in the bar it appears below, but if I click outside the information doesn’t desappear.
46

Could anyone help me?

1 Like

I created a step-by-step guide for building an autocomplete search function. The search focus group appears when there are autocomplete suggestions and hides when there is none.

The Bubble editor is also there in case you want to copy the workflows and elements to your app directly.

1 Like