Filtering a search by related thing's distance

OK, so I have two sets of data. Category and Locations that have that Category. (so a one to many).

To make things easier I have a list of Locations on the Category, and I am also adding a count of locations so I can directly sort on this.

I need to be able to filter the list of Categories based upon distance from Current Position. I can’t do this on the database, as it is dynamic.

Is there any way to do this ?

Trying it the other way round…

I can create a list of Location Categories that are nearby…but then I get duplicates in the list if there are two places nearly with the same Category. But I can’t find a way to remove duplicates from the list.

Any thoughts ?

1 Like

It’s not something we support yet, but it’s on our list.

So…tried it yet another way…

Created a dataset which just contains address and category combinations (i.e. the raw data, not links).

And I tried to only create the thing, when there isn’t a another thing of the same category nearby.

But no, you can’t do that sort of thing in an action “and when” constraint it seems.

So…let’s try searching for all nearby category/addresses and storing them as a custom state.

Well, that works I think. I had to do it by storing the text values as the state, and comparing that.

Quite a long winded way of doing this though :smile:

1 Like

Has this feature been added (ability to include distance as part of a search if I know the current user’s address)?

Sure is. Just make sure the data you have saved is a ‘Geographic Address’. Try playing around with it and you’ll figure it out

2 Likes

Unfortunately this doesn’t sort by distance, it merely filters by distance.

I don’t know if this answer is still necessary, but I managed to make this classification that I put from the closest to the farthest.

1 Like

This is an old post, but has this been implemented?

I am trying to do this without success;

Data Type = Show which has a Show_Venue which is an instance of a Venue
Data Type = Venue which has a Venue_Location

I want a repeating group that I can filter on distance between current geographic location and Venue Location.

I don’t seem to be able to add this as a constraint?

I wanted to do this dynamically based on the users current location but that isn’t possible

so the closest I could get was to store the “miles from” a central location as a number on the company/venue

I could then sort low to high

this worked in my situation since the users are all only in 1 state so I could set it to just miles from capital city which was good enough