Search for adresses on the map that land within other list of adresses

I have a list of locations ( on the map but I created a test page with just a list for making it easier )
and I have another list of addresses that are broader.
what I’m trying to do is filter locations based on broader locations.

I’m having problem while filtering.

So an example would be like an Airbnb houses locations and if a person were to input multiple locations like New York, Los Angeles and Miami. The map to show list of all locations that land in all these three cities.

Specific Locations is a Type in my app and general locations like cities are field - list of geographic adresses

I think you’ll need three separate searches and merge them.

For e.g.:

image

Operators and comparisons | Bubble Docs

Hey @leotavdgiridze. I think you can do this with an advanced filter. See the demo below:
chrome_kP85FKrZsj

In this demo, you have a list of displays in your system with some address (left-most). And some locations are chosen by the user (center, checked means it is chosen). And the right-most RG shows the filtered displays with respect to the chosen locations by using advanced filter.

How?

  1. You search for display as usual without the location constraint and filter it.
  2. Advanced filter logic is this:
    a. Get all the locations via Search for Locations (I get them from DB with enabled flags checked, you can get them from anywhere: custom state, user, previous page…)
    b. Each of these location’s distance from the This Display’s location will be calculated like in the picture.

    c. Then, you will filter each distance based on some number you chose (I chose 10 miles): This is the ...Location:filtered... in the above picture.
    image
    d. And finally, you get the ones with count>0 (again the step b’s picture’s count>0 part) which means if any of the locations are within 10 mile radius of this Display (which means something we want).

That’s technically it.

Here is the editor if you want to analyze it yourself: Tests for Forum 13 | Bubble Editor

Note: I guess advanced filter slows things down because it happens in the frontend in this case. So you may want to move this operation to backend in some way.

1 Like

Not sure where I’m going wrong but after trying 20 times this is what I noticed.
My list of broad locations is a list. you have them as types.
so in the advanced filter I’m pulling that list of broad locations by: Current page’s campaign’s locations ( this is a list )

Than each item distance from:

and there is no option for me to choose the type Display. not sure why

also what are the ways to do this on the server side? and is it going to speed up the process?

That’s ok. Any list is fine. I was getting the location fields of the type anyway.

That’s another thing. I forgot to mention I think. You select some data source and then clear it and then This Display become available. Probably a bug and needs to be reported.

1 Like

Sounds great. it worked.

how do I ignore empty constraints because I tried checking the box everywhere didn’t help

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