Need help, how do you make a database search

I have struggled trying to work out how to make a database search can anyone help me

the one I have currently it doesn’t even search it just shows the current things inside a repeating group but not filtered

Hi @sean1406.st

I think your question needs to be a bit more specific as in is this on a group or a repeating group? Have you setup data types already? And what are your end goals for the search?

I suggest if you haven’t already looking at the Bubble tutorials offered in your account, its a good way to get the basics down.

As for searching the database, there are a few ways, but generally its the expression ‘Do a search for’.

For instance if I wanted to display the list of users on my app, I draw out the repeating group and set the data type to ‘User’.

For the data source this is where we point to the actual data. So this is what we have:

The pop out will slide to confirm the type of data you want to search for. This can be different to the actual type of content on the repeating group - but to keep things simple lets say its still a User we want to search for in our database.

Once we’ve selected users this will perform the search. We can then use constraints to filter the data on the search.

So in this example I have a field on the User data type that is labelled as Age and set to a number. Then on the constraints I’m putting in - it will only show users who’s age is equal to 21 OR greater than 21, so not pulling in data who is a user under 21.

image

You can also use the sorting to order the data from the search just as you’d like. For instance when I’m performing this search for the users over 21, I could return the users in this repeating group from youngest to oldest (low to high).

image

Hopefully this clears up, how to search the database and provide some filtering. You are free to add many constraints to the search to really refine the results.

1 Like

Where it says age how can I change that to most similar or exact to what is typed in the search box I have made

What is your data type and what fields inside the data type do you want to search? E.g. House as a data type and the field ‘Name’…or are you wanting to have multiple fields searchable within your search box?