Saltwater USA
Posts: 0
Joined: Thu Oct 23, 2014 2:18 am

JSON array retrieve

I coded following JS handler,

var day = list[1].dt;

to success event to get the second "dt" in the array but I get the first "dt."
Even though I change the number in [] to 2 and 3, the result is the same.

How can I fix this?

Thanks!!

"list":[
{
"dt":1415116800,
"temp":{
"day":60.96,
"min":58.66,
"max":60.96,
"night":58.66,
"eve":60.96,
"morn":60.96
},
"pressure":1027.97,
"humidity":46,
"weather":[
{
"id":803,
"main":"Clouds",
"description":"broken clouds",
"icon":"04n"
}
],
"speed":7.47,
"deg":212,
"clouds":76
},
{
"dt":1415203200,
"temp":{
"day":60.26,
"min":50.49,
"max":64.96,
"night":54.41,
"eve":63.95,
"morn":53.64
},
"pressure":1030.48,
"humidity":54,
"weather":[
{
"id":803,
"main":"Clouds",
"description":"broken clouds",
"icon":"04d"
}
],
"speed":3.18,
"deg":226,
"clouds":68

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

JSON array retrieve

Hello!

Please verify that the service has a valid JSON response format here:
http://jsonlint.com/

Saltwater USA
Posts: 0
Joined: Thu Oct 23, 2014 2:18 am

JSON array retrieve

Yes the JSON response is valid.

Image

Saltwater USA
Posts: 0
Joined: Thu Oct 23, 2014 2:18 am

JSON array retrieve

Yes the JSON response is valid.

Image Image

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

JSON array retrieve

Hello!

Did you create response parameters automatically?
http://devcenter.appery.io/documentat...

Saltwater USA
Posts: 0
Joined: Thu Oct 23, 2014 2:18 am

JSON array retrieve

Hi!

Fortunately, I got the other one working
but for other JSON response I can't retrieve any of the values.
I also validated this JSON response.

for the JS handler I coded

var t=predictions.t;
var v=predictions.v;

Image Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

JSON array retrieve

Hi Saltwater,

Your mapping looks good. But it's not clear what you use in "JS" for these links.

http://prntscr.com/53hthv/direct

And it's not clear what result you have.. Do you have items with empty values?

If so you try - to delete code in "JS" for links in mapping.

Regards.

Saltwater USA
Posts: 0
Joined: Thu Oct 23, 2014 2:18 am

JSON array retrieve

Hi Yurii,

I tried deleting the JS code already, but it would not retrieve data anyhow.

For t and v, I used followings:

var t=predictions.t;

var v=predictions.v;

Also, here is imported responses from the REST service.

Thank you!

Image

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

JSON array retrieve

Hi Saltwater,

pre

var t=predictions.t;

var v=predictions.v;

/pre

That's code does nothing.. Also i guess you could have some errors in console with this code.

Currently i can not say what is wrong, thus please give us your app public link and describe steps to reproduce this problem in your app and we will take a look closely.

Regards.

Return to “Issues”