Page 1 of 1

JSON array retrieve

Posted: Wed Nov 05, 2014 1:39 am
by Saltwater USA

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


JSON array retrieve

Posted: Wed Nov 05, 2014 6:16 am
by obullei

Hello!

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


JSON array retrieve

Posted: Wed Nov 05, 2014 2:27 pm
by Saltwater USA

Yes the JSON response is valid.

Image


JSON array retrieve

Posted: Wed Nov 05, 2014 2:33 pm
by Saltwater USA

Yes the JSON response is valid.

Image Image


JSON array retrieve

Posted: Wed Nov 05, 2014 6:19 pm
by Maryna Brodina

Hello!

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


JSON array retrieve

Posted: Wed Nov 05, 2014 6:52 pm
by Saltwater USA

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


JSON array retrieve

Posted: Thu Nov 06, 2014 3:29 am
by Yurii Orishchuk

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.


JSON array retrieve

Posted: Thu Nov 06, 2014 2:13 pm
by Saltwater USA

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


JSON array retrieve

Posted: Fri Nov 07, 2014 1:29 am
by Yurii Orishchuk

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.