+ Start a Discussion
Big EarsBig Ears 

Using DISTANCE in a SOQL query - Retrieving and presenting the distance

As of Spring '16, we can now retrieve the distance, as well as sort/filter by it:


However, the documentation doesn't seem to indicate how we are supposed to access and retrieve this value from the returned results. It just seems to not be included along with the other columns.

Has anybody else used this functionality? It would be very useful to get my head around it.

Best Answer chosen by Big Ears
Big EarsBig Ears
I found the answer on Stackexchange. You use Aliasing and the .get() notation to get the alias.