Searching locations based on coordinates.

tahnalos
Kilo Sage

My client uses the Locations table in order to provide a mapping of all servicable assets for our technicians.  However, a new request has come in to be able to search for these locations based on the input of coordinates.  They are asking to narrow down to locations nearest to inputted coordinates with maximum distance of 500 meters.

Is there a script that can help calculate distance and convert that to meters?

1 ACCEPTED SOLUTION

Check if this is helpful

https://stackoverflow.com/questions/5260423/torad-javascript-function-throwing-error


Please mark this response as correct or helpful if it assisted you with your question.

View solution in original post

10 REPLIES 10

It was.  Looks like the toRad/toRadians function is not defined within ServiceNow, but there was this equation which I ended up using:

this * Math.PI / 180