-
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
Salesforce declares a new Content Management System
Salesforce announced a new tool named Salesforce Content Management System recently which is designed in an optimized manner to deliver a quality customer experience across multiple channels. The…
Connect Salesforce to Power BI: 2 Easy Methods
A. Power BI and Business Analytics Before panning our attention to the need for integrating Power BI with sales management platforms like Salesforce, let us get…
Unleashing Potential: A Strategic Roadmap to Salesforce Staff Augmentation
In the vast landscape of business evolution, there exists a compass that navigates the treacherous waters of innovation and efficiency—Salesforce staff augmentation. This strategic beacon…
Popular Salesforce Videos
Automate Simple Business Processes with Process Builder | Salesforce Trailhead
In this video, we working on the Trailhead challenge Lightning Flow unit Automate Simple Business Processes with Process Builder where a lot of trailblazers face…
How to Set Up Salesforce Knowledge in Service Cloud
Help your customers and agents find answers they are searching for faster with Salesforce Lightning Knowledge. In this video, we will review: - All components…
Methods in Salesforce - All You Need to Know
Learn All About Methods in Salesforce. Watch this video and do let us know if you have any doubts or concerns. What is a Method…