You need to sign in to do that
Don't have an account?
Wasim Akram
Parsing of JSON Please Help me its Urgent
{
"results" : [
{
"address_components" : [
{
"long_name" : "Nagina Bagh",
"short_name" : "Nagina Bagh",
"types" : [ "neighborhood", "political" ]
},
{
"long_name" : "Ajmer",
"short_name" : "Ajmer",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Ajmer",
"short_name" : "Ajmer",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Rajasthan",
"short_name" : "RJ",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "India",
"short_name" : "IN",
"types" : [ "country", "political" ]
},
{
"long_name" : "305001",
"short_name" : "305001",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "Nagina Bagh, Ajmer, Rajasthan 305001, India",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 26.4724746,
"lng" : 74.6370874
},
"southwest" : {
"lat" : 26.4706488,
"lng" : 74.63420139999999
}
},
"location" : {
"lat" : 26.4716456,
"lng" : 74.63528549999999
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 26.4729106802915,
"lng" : 74.6370874
},
"southwest" : {
"lat" : 26.4702127197085,
"lng" : 74.63420139999999
}
}
},
"place_id" : "ChIJ9_UJ6ADnazkRhtNauR-cCHc",
"types" : [ "neighborhood", "political" ]
}
],
"status" : "OK"
}
"results" : [
{
"address_components" : [
{
"long_name" : "Nagina Bagh",
"short_name" : "Nagina Bagh",
"types" : [ "neighborhood", "political" ]
},
{
"long_name" : "Ajmer",
"short_name" : "Ajmer",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Ajmer",
"short_name" : "Ajmer",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "Rajasthan",
"short_name" : "RJ",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "India",
"short_name" : "IN",
"types" : [ "country", "political" ]
},
{
"long_name" : "305001",
"short_name" : "305001",
"types" : [ "postal_code" ]
}
],
"formatted_address" : "Nagina Bagh, Ajmer, Rajasthan 305001, India",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 26.4724746,
"lng" : 74.6370874
},
"southwest" : {
"lat" : 26.4706488,
"lng" : 74.63420139999999
}
},
"location" : {
"lat" : 26.4716456,
"lng" : 74.63528549999999
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 26.4729106802915,
"lng" : 74.6370874
},
"southwest" : {
"lat" : 26.4702127197085,
"lng" : 74.63420139999999
}
}
},
"place_id" : "ChIJ9_UJ6ADnazkRhtNauR-cCHc",
"types" : [ "neighborhood", "political" ]
}
],
"status" : "OK"
}
Go to https://json2apex.herokuapp.com/
Paste your json there and you will get apex class. Based on the Apex class you can get the values and display it on vf page.
i'm new in salesforce so i can't understand generated code it can not return result as i want so can you explain me please