Calculating distance between two points - error message

Options
Mr_English
Mr_English Member
edited March 2023 in ? Transforming data

I would like to calculate the distance between a start point and all the records in the table. The requirement is to find all Users within 50 miles of the input location ( = ‘place’).

Question 1: Is there a way to do this in a Custom Query? I've tried but there doesn't appear to be a way.

Question 2: Is there a way to get the distance between geo_points, rather than lat/long pairs?

I am working with this data:

This is the function stack and calculate distance form:

This is the Run & Debug:

Which generates this error:

Tagged:

Best Answers

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Answer ✓
    Options

    place.long is recorded as “text” instead of a “var”. Click on the 2.1 in your function stack, click the “longitude_2” field, and select the “place” variable to make sure it uses that. You'll the the little notice in the upper-left of the input box go from “text” to “var:any” - should work better.

    If that doesn't seal up your issue, please post what you get at that point!

  • Mr_English
    Mr_English Member
    Answer ✓
    Options

    @Ray Deck Hi ahh I didn't see that one. This has caught me out in the past. Thanks Ray.