Skip to main content
Question

jsonfragmenter: How to flatten attributes which are deeper in the data structure?

  • April 2, 2020
  • 1 reply
  • 15 views

Forum|alt.badge.img

I am using the jsonfragmenter to expose the attributes "name", "street", "city", "zip" in the following json.

I want to also expose the geographicpoint attribute and append the "latitude","longitude" as a field on the same level as the other attributes so that I can obtain the following data structure.

"name""street""city""zip""latitude""Longitude"

 

How can I delve into the "geographicalPoint" attribute and flatten ist further in my schema?

 

 JSON

{"name":"Medicus-Apotheke","street":"Walsroder Str. 8","city":"Soltau","zip":"29614","email":"medicusapotheke@googlemail.com","geographicalPoint":{"latitude":"52.9836451","longitude":"9.8358444"},"contactName":"   Andreas Hagedorn","services":[{"service_id":34,"service_name":"Krankenpflege","service_icon":"ico_krankenpflege.png","service_url":"","service_descript":"Krankenpflege","service_longdescript":"Krankenpflege","service_type":0},{"service_id":35,"service_name":"Verleih","service_icon":"ico_verleih.png","service_url":"","service_descript":"Verleih","service_longdescript":"Verleih","service_type":0},{"service_id":30,"service_name":"Tests","service_icon":"ico_tests.png","service_url":"","service_descript":"Tests","service_longdescript":"Tests","service_type":0},{"service_id":17,"service_name":"Verleih von Milchpumpen","service_icon":"ico_milchpumpe.png","service_url":"","service_descript":"Verleih von Milchpumpen","service_longdescript":"Verleih von Milchpumpen","service_type":0},{"service_id":27,"service_name":"Bargeldlose Zahlung","service_icon":"ico_zahlung.png","service_url":"","service_descript":"Bargeldlose Zahlung","service_longdescript":"Bargeldlose Zahlung","service_type":0},{"service_id":29,"service_name":"Schwerpunkt Ernährung","service_icon":"ico_ernaehrung.png","service_url":"","service_descript":"Schwerpunkt Ernährung","service_longdescript":"Schwerpunkt Ernährung","service_type":0},{"service_id":33,"service_name":"Anmessen","service_icon":"ico_anmessen.png","service_url":"","service_descript":"Anmessen","service_longdescript":"Anmessen","service_type":0},{"service_id":28,"service_name":"Sprachen","service_icon":"ico_sprachen.png","service_url":"","service_descript":"Sprachen","service_longdescript":"Sprachen","service_type":0},{"service_id":32,"service_name":"Eigenherstellung","service_icon":"ico_eigenherstellung.png","service_url":"","service_descript":"Eigenherstellung","service_longdescript":"Eigenherstellung","service_type":0},{"service_id":7,"service_name":"Schwerpunkt Homöopathie","service_icon":"ico_homoeo.png","service_url":"","service_descript":"Schwerpunkt Homöopathie","service_longdescript":"Schwerpunkt Homöopathie","service_type":0},{"service_id":21,"service_name":"Schwerpunkt Aromatherapie","service_icon":"ico_aromatherapie.png","service_url":"","service_descript":"Schwerpunkt Aromatherapie","service_longdescript":"Schwerpunkt Aromatherapie","service_type":0}],"emergencies":[],"phone":"05191/1 25 55","website":"http://www.medicusapotheke.de","preorder":"https://medikamente.apotheken.de/8218","openingsParsed":"<span class=\"openday\">Mo-Fr</span> <span class=\"opentime\">08:00-18:30</span>\n<span class=\"openday\">Sa</span> <span class=\"opentime\">08:00-12:30</span>","warningIn":555,"id":"8218","apoDEshop":null,"apoInactive":null,"isMember":true,"app_active":"1"}

 

1 reply

virtualcitymatt
Celebrity
Forum|alt.badge.img+35

As a tip, you can save the JSON as a file and use the JSON reader to help figure out the correct JOSN expression to get.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings