Autocomplete search and loading info from database

Hi!

I have one page in Bubble with a search input, where people can search for radio programs that I have stored in a database (each program has different fields, like duration, topic, etc.). The intention is that when a user searches something like “Mus” the autocomplete function shows all the programs starting with the word “Mus” (e.g. “Music of the 60s”). The user selects one and press on the Search button and goes to the next page in which he sees some information about that program(taken from the database).

So, I have 2 questions:

  1. How can I use the autocomplete function for the search box to display possible results dynamically?
  2. I guess now I move that info to the next page using the Key “search” = what I send from the previous page, but how can I use it to display the titles of the program and other info relative to that certain program in the next page? Anyway, without the autocomplete function, I can’t access any of the programs from the search box, since I guess I have to put exactly the name of the program in the search box. I’m stuck in this place of the pic:

Thanks a lot for the help!

1 Like

Hey @eugenio :slight_smile: If you switch the element from an Input to a Search Box, that will automatically set the input to Autocomplete:

The data which autocompletes depends on the data you select after clicking “Define list of Options”

In your app, this will be similar to the Program data screenshot you posted. If you wanted all Topics to be option to autoselect, the data could look something like:

Then, to ensure the User is taken to the page which views individual programs after selecting a Program from the dropdown, you could set up a workflow such as:

*Make sure the Program Page’s type of content is Program:

Then you can set up elements on the Program page such as “Current Page Program’s Topic” (text element), “Current Page Program’s Image” (image element) to display the data of the Program the User is viewing on the Program page:

And that should work! :slight_smile: If you have any questions, feel free to share a link to your app, and I’d be happy to help set this up!

6 Likes

@fayewatson, you made my day. THANKS a lot for the detailed info and your help. I followed your instructions and now everything works amazing. Really, you´ve helped me a lot :slight_smile: Thank you once again!

1 Like

Aww, yay!! :blush: My pleasure, @eugenio! So glad to hear that you got it working as you needed it to in your app!

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