function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Drew Gourlie 8Drew Gourlie 8 

Unable to retreive Lat/Longs from Contact object

When querying the API, I am able to return results for all fields except Lat/Long. When looking that those fields, only a NULL value is returned. Is they any way to change this?
Amit K AAmit K A
Could you please post your code?
Drew Gourlie 8Drew Gourlie 8
I have tried executing both of these queries. Both returned NULL for Latitude and Longitude.
 
select FirstName, LastName, MailingAddress, phone, email, Title, Id, LastModifiedDate from Contact;

select FirstName, LastName, MailingLatitude, MailingLongitude, phone, email, Title, Id, LastModifiedDate from Contact;
Vishal_GuptaVishal_Gupta
Hi Drew,

You need to first save  Latitude and Logitude values in Contact object, you can use google.maps.Geocoder to fetch these values using Contact Mailing Adress and save in relevent fields.

Thanks,
Vishal