-
What is the best way to parse the JSON response that comes from google map?
Hi All,
What is the best way to parse the JSON response that comes from google map?
JSON Response:
up vote1down votefavorite
I've written something that will get the longitude and latitude from a Google Geocode Callout.The response we get from a generic callout looks like this:
{
results=( {
address_components=( {
long_name=1600,
short_name=1600,
types=(street_number
)
},
{
long_name=Amphitheatre Parkway,
short_name=Amphitheatre Pkwy,
types=(route)
},
{
long_name=Mountain View,
short_name=Mountain View,
types=(locality,
political)
},
{
long_name=Santa Clara County,
short_name=Santa Clara County,
types=(administrative_area_level_2,
political)
},
{
long_name=California,
short_name=CA,
types=(administrative_area_level_1,
political)
},
{
long_name=United States,
short_name=US,
types=(country,
political)
},
{
long_name=94043,
short_name=94043,
types=(postal_code)
} ),
formatted_address=1600 Amphitheatre Pkwy,
Mountain View,
CA 94043,
USA,
geometry= {
location= {
lat=37.4223582,
lng=-122.0844464
},
location_type=ROOFTOP,
viewport= {
northeast= {
lat=37.4237071802915,
lng=-122.0830974197085
},
southwest= {
lat=37.4210092197085,
lng=-122.0857953802915
}
}
},
place_id=ChIJ2eUgeAK6j4ARbn5u_wAGqWA,
types=(street_address)
} ),
status=OK
}Thanks
Log In to reply.
Popular Salesforce Blogs

Boost Your Sales with Effective Email Pitch Strategies in Salesforce
Clear communication with prospects is the key to building relationships and increasing sales, especially for B2B businesses. As B2B sales involve higher transaction value and…

Salesforce Data Loss: Is Your Data Correct? How Can UI Contribute?
For a number of years security and safety of data has been the major reason which proved itself to be a hiccup in the path…

4 Security Mistakes to Avoid in Salesforce
76% of IT security leaders say they've experienced a data breach in at least one of their business systems. Needless to say, it’s important to follow…
Popular Salesforce Videos
Write Tableau CRM Data to Salesforce Objects
Use Tableau to blend Salesforce data from across the Customer 360 platform with your other business data for increased visibility and a deeper understanding of…
4 Salesforce Implementation Challenges Faced by Enterprises
Let's have a look at some of the common challenges enterprises face while implementing Salesforce platform, if you need any help in implementing Salesforce from…
Successfully Retrieving Metadata From Salesforce org Using Packages
In this session, we will uncover various strategies that developers can use to pull metadata from Salesforce org successfully. Watch this video and learn everything.…