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.
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
Hey @leotavdgiridze. I think you can do this with an advanced filter. See the demo below:
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?
You search for display as usual without the location constraint and filter it.
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.
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).
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.
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 )
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.