Forum Documentation Showcase Pricing Learn more

Cannot pass data from search box when I go to another page

I’d like to pass geolocation data from the search box in my header to a page that displays results based on a geolocation.

You need to set the type of the page you are sending to - make sure it’s the same as the type for the search input.
There is a tiny text that says “Incompatible types” in the screenshot :smile:

Ok. How does one set a page type? :smiley:

That doesn’t answer my question.

I want to pull some data from my database, but I need to query the data based on location.

How do I pass in a location?

Have you done the tutorials on the Dashboard?
I particularly suggest “Saving data”, “Sending data to pages” and Using “APIs and sending data to groups”
They hold the key to many of your questions :smile:

Yup, I’ve watched all the videos. I still can’t figure out how to build a search box in the header that uses the geolocation autocomplete :wink:

Like this?

Add a “Search box” item and set “Choices style” to Geographic places like so

That’s what I have already…

The question is how do I use the data within another page form

I need to enable the user to perform search functions on a default search bar

The search obviously has to be able to be done anywhere, from any page, and still work

Then, the user is returned a list of results that he or she can analyze, based on the specified location.

can you create a new thing called current search and when you make the search have it save the info there?
then you can access the search info on any page. would this work?

Your original idea of placing it in the header is fine.

When the search box’s value is changed, you can save the address on a custom state of type Geographic address on the Header, and then navigate to the search_media page, where you now have access to the address on the header’s custom state.

1 Like

However, I cannot then navigate to the next page without passing some data…

How would I be able to query the database using the geolocation

Do I need to pass some data, even though data is saved in the header

In other words, how do I make sure that the geolocation the user enters is used in the search on next page when I query the db

I am not sure how to reference the header value in order to find items that are within a certain radius of a location. Especially since this is a feature premade by Bubble with the geolocation autocomplete

Also how do I allow user to submit the search box content with Enter key press.

You can send data between pages using URL parameters

To consume the parameters in the newly opened page use the dynamic expression builder :

When you press enter, the system is smart and auto-magically figures out it should press the button associated with the workflow :wink:

Let us know if you have more questions!