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


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