Answer the question
In order to leave comments, you need to log in
How to extract values of individual array/JSON fields?
Greetings.
There is JSON (or an array with JSON elements, correct as correct) which I receive via API in response.
Here is a snippet of the data structure:
{"lat":59.57,"lon":30.19,"timezone":"Europe/Moscow","timezone_offset":10800,"current":{"dt":1643461224,"sunrise":1643437084,"sunset":1643465183,"temp":-3.38,"feels_like":-7.07,"pressure":1005,"humidity":94,"dew_point":-4.11,"uvi":0,"clouds":100,"visibility":10000,"wind_speed":2.54,"wind_deg":187,"wind_gust":6.33,"weather":[{"id":804,"main":"Clouds","description":"overcast clouds","icon":"04d"}]},"daily":
var lat = request.response.lat;
Answer the question
In order to leave comments, you need to log in
You can extract them without enumeration - by index - for example -> request.response.daily[0].moonrise and if the indexes come randomly - then filter js will save you - and there is a condition in the filter, for example, the presence of a field in the object.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question