Nearby users in list form

Hi world,

I am trying to sort a list of users by proximity to the current user via zip codes in the user database which they enter when signing up.

I have the list set up currently so a user can search through for users in a specific zip code.

But it needs to be sorted by proximity somehow. The only sorting options is by ‘zip code - High to Low’ and ‘Low to High’.

Please advise.

Thanks for reading, have a great day.

Mr DJ

Hi DJ,

You could use Google Matrix API to calculate distances between two points. You would need to pass all of the zip codes through this to calculate the distance for each zip code to the current user’s zip code.

We made a short video of this for a single address. You can see it here: https://youtu.be/OZenvk1QPG0

Erik

Hi thanks for your response. I watched the video it was very informative. Do you know if I would be able to build a custom action into the sort feature? Currently I do not see any way to sort with a custom action unfortunately.

To be honest, I’m not sure the best way to do this without testing it myself.

It might be best to wait for Adalo to release the GPS feature before proceeding with this specific item, that’ll make it a lot easier.

For the time being, instead of zip code why not show accounts in the same city?

Hi Erik,

Thank you for that work around and my girlfriend actually gave me that same advice which I will be doing but ideally it would sort by zip code. For instance, Raleigh where I live is very large and has quite a few zip codes.

In that case it may not show the closest user around you but a zip code would dial it in close enough for my app’s purpose. This will really only be a problem when there are a very large number of users registered in my app but obviously that is the goal.

I wonder how the ‘tinder style’ app built on adalo would work… I’m going to check and see but if anyone else has any input it is greatly appreciated.

As of now I see no way of custom sorting so it may be something Adalo would just need to add to its system unless I could make it as a custom component. But I’m not that skilled yet.

Thanks again

MrDJ

Do the cities for now. Adalo will have native GPS in the next few months which will include the ability to determine distances between multiple points (i,e, a list of users). You can make the cahnge in the future.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.