Forum Academy Marketplace Showcase Pricing Features

Repeating group filtering within a geographic area

Hi,

I rent books.

Book A is available only in the geo addresses “Miami” and “Orlando”.

Book B is available only in the geo addresses “New York”, “Paris” and “London”.

Book C is available only in the geo addresses “Miami”, “Paris” and “London”.

I would like to show in a repeating group all the books available in the geo address “Florida, USA” (in this case, those would be Book A and Book C).

How can I implement this filter in the repeating group?

Google maps region code biasing might be what I need. Geocoding Service  |  Maps JavaScript API  |  Google Developers. How can I use region code biasing with Bubble’s google maps API?

Thanks.

I built a test using the same data you sent here
image

and in my front i have a RG with a filter for states, when empty, it shows ALL books, if one selected, it only shows the books in that location
image
image

When the dropsown is empty, it does a normal data fetch

If not, it filters each item’s location state, in this case, my dropdown has static choices, but you could make it dynamic
image
image

Hope it helps!

1 Like

Hi! I just saw this. I did not know the “extract” function, it is great! Works perfectly. Thanks!

1 Like

Hey!

In an example where I extracted the “state” of Miami (Florida),

How can I get Google’s Place ID of Florida without making the user run a new search?

Please let me know if you have any idea,

Thanks!

mmm i don’t know if you can extract the place ID directly (i think that you are talking about THIS), but you could extract the latitude and longitude of the location (you can grab the searchbox and extract their value’s long and lat, so user have to write only once)

Yes, I am talking about that.

This is what I want to accomplish:

I want to save Miami, Florida as a data type “City”.

“City” has the following data fields:

“This city Place ID” (in this case, Miami’s ID).

“This city’s state Place ID” (in this case, Florida’s place ID)

“This city’s country Place ID” (in this case, USA’s place ID).

I need to save all that data by only using the searchbox once (in this case, when I search for Miami).

Any ideas on how to do it?

Why no saving the Location in a Location field, then you could extract all this data from this field?

So, for example, you would have:
CITIES:

  • name (text type): city 1 || location (location type): {{city location}}

then when you grab city 1, you could extract every field from its location field

Its because when the user has another language setup, the location from google is retrieved in his language.

So, for example, if a Russian searches for Miami, then Miami would be saved as “Майами” in my database.

Then if an English speaking user looks for Miami in my apps database, it will not found it amongst the saved locations, although it is actually there (its just that it was saved as “Майами”).

Thats why I don’t want to save names or addresses but Google Places ID’s for each place in my database.

oh i get it, i don’t know if you can save the address in a default language. another approach could be saving the latitude and longitude of the place and when searching for places (assuming you are using a RG) you could grab each item lat, long:extract {something}. But not sure if it would work.
The other option would be manually setting the Maps/places API to get the ID in the request maybe?.
You could try also this plugin that is like a bubble map on steroids

1 Like

Thanks! I’ll check the alternatives

1 Like