Transcript
In this Quick Tip, we're going to learn about one of the most frequently used expressions in Bubble: Do a Search For.
Every app uses data types to express what their application does—like the User type, which comes built in and allows for users to sign up and log in. It's your job to define these data types and their custom fields.
But when you want to retrieve any user-submitted thing for these data types, that's the job for Do a Search For.
Do a Search For returns a list of things from the database, and it's one of the most frequent expressions you'll be writing in Bubble. It's most commonly used with repeating group data sources—like this one here.
This repeating group has a type of content stating we need to find Users, so it's expecting the data source to find us that list of users.
In the data source, we will Do a Search For. When we choose it, we're shown the search palette, which lets us pick the thing we want to find.
We're shown all of our data types in this dropdown, but we'll pick User, the one that matches with our type of content.
Now we've successfully told this repeating group to Do a Search For All Users.
We can also specify a sort order or constrain the search to get specific results back from our list—but those topics deserve their own video, so we'll keep it like this.
Now that the data source for this element is set, we'll add a text box and set the current cell's email to visualize our results.
When we preview, we'll retrieve the list of entries from our User database—thanks to Do a Search For.
Now that we've seen how to Do a Search For anything in your app data, experiment with it on your own.
That's it for this Quick Tip! For more, be sure to check out bubble.io/academy.